[-]
[+]
|
Changed |
php5-xdebug.changes
|
|
[-]
[+]
|
Changed |
php5-xdebug.spec
^
|
|
|
Changed |
xdebug-2.2.4.tgz/xdebug-2.2.4/debugclient/missing
^
|
[-]
[+]
|
Deleted |
xdebug-2.2.4.tgz/xdebug-2.2.4/php_xdebug.h
^
|
@@ -1,293 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Xdebug |
- +----------------------------------------------------------------------+
- | Copyright (c) 2002-2013 Derick Rethans |
- +----------------------------------------------------------------------+
- | This source file is subject to version 1.0 of the Xdebug license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://xdebug.derickrethans.nl/license.php |
- | If you did not receive a copy of the Xdebug license and are unable |
- | to obtain it through the world-wide-web, please send a note to |
- | xdebug@derickrethans.nl so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@xdebug.org> |
- +----------------------------------------------------------------------+
- */
-
-#ifndef PHP_XDEBUG_H
-#define PHP_XDEBUG_H
-
-#define XDEBUG_NAME "Xdebug"
-#define XDEBUG_VERSION "2.2.4"
-#define XDEBUG_AUTHOR "Derick Rethans"
-#define XDEBUG_COPYRIGHT "Copyright (c) 2002-2014 by Derick Rethans"
-#define XDEBUG_COPYRIGHT_SHORT "Copyright (c) 2002-2014"
-#define XDEBUG_URL "http://xdebug.org"
-#define XDEBUG_URL_FAQ "http://xdebug.org/docs/faq#api"
-
-#include "php.h"
-
-#include "xdebug_handlers.h"
-#include "xdebug_hash.h"
-#include "xdebug_llist.h"
-#include "xdebug_code_coverage.h"
-
-extern zend_module_entry xdebug_module_entry;
-#define phpext_xdebug_ptr &xdebug_module_entry
-
-#define MICRO_IN_SEC 1000000.00
-
-#define OUTPUT_NOT_CHECKED -1
-#define OUTPUT_IS_TTY 1
-#define OUTPUT_NOT_TTY 0
-
-#ifdef PHP_WIN32
-#define PHP_XDEBUG_API __declspec(dllexport)
-#else
-#define PHP_XDEBUG_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-#include "main/SAPI.h"
-
-#if MEMORY_LIMIT
-# define HAVE_PHP_MEMORY_USAGE 1
-#elif PHP_VERSION_ID >= 50201
-# define HAVE_PHP_MEMORY_USAGE 1
-#else
-# define HAVE_PHP_MEMORY_USAGE 0
-#endif
-
-#if PHP_VERSION_ID >= 50200
-# define XG_MEMORY_USAGE() zend_memory_usage(0 TSRMLS_CC)
-# define XG_MEMORY_PEAK_USAGE() zend_memory_peak_usage(0 TSRMLS_CC)
-#else
-# define XG_MEMORY_USAGE() AG(allocated_memory)
-# define XG_MEMORY_PEAK_USAGE() AG(allocated_memory_peak)
-#endif
-
-#if PHP_VERSION_ID >= 50300
-# define XG_SAPI_HEADER_OP_DC , sapi_header_op_enum op
-# define XG_SAPI_HEADER_OP_CC , op
-#else
-# define XG_SAPI_HEADER_OP_DC
-# define XG_SAPI_HEADER_OP_CC
-#endif
-
-PHP_MINIT_FUNCTION(xdebug);
-PHP_MSHUTDOWN_FUNCTION(xdebug);
-PHP_RINIT_FUNCTION(xdebug);
-PHP_RSHUTDOWN_FUNCTION(xdebug);
-PHP_MINFO_FUNCTION(xdebug);
-ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xdebug);
-
-#ifndef PHP_WIN32
-int xdebug_is_output_tty();
-#endif
-
-/* call stack functions */
-PHP_FUNCTION(xdebug_get_stack_depth);
-PHP_FUNCTION(xdebug_get_function_stack);
-PHP_FUNCTION(xdebug_get_formatted_function_stack);
-PHP_FUNCTION(xdebug_print_function_stack);
-PHP_FUNCTION(xdebug_get_declared_vars);
-PHP_FUNCTION(xdebug_call_class);
-PHP_FUNCTION(xdebug_call_function);
-PHP_FUNCTION(xdebug_call_file);
-PHP_FUNCTION(xdebug_call_line);
-
-PHP_FUNCTION(xdebug_set_time_limit);
-
-PHP_FUNCTION(xdebug_var_dump);
-PHP_FUNCTION(xdebug_debug_zval);
-PHP_FUNCTION(xdebug_debug_zval_stdout);
-
-/* activation functions */
-PHP_FUNCTION(xdebug_enable);
-PHP_FUNCTION(xdebug_disable);
-PHP_FUNCTION(xdebug_is_enabled);
-
-/* breaking functions */
-PHP_FUNCTION(xdebug_break);
-
-/* tracing functions */
-PHP_FUNCTION(xdebug_start_trace);
-PHP_FUNCTION(xdebug_stop_trace);
-PHP_FUNCTION(xdebug_get_tracefile_name);
-
-/* error collecting functions */
-PHP_FUNCTION(xdebug_start_error_collection);
-PHP_FUNCTION(xdebug_stop_error_collection);
-PHP_FUNCTION(xdebug_get_collected_errors);
-
-/* profiling functions */
-PHP_FUNCTION(xdebug_get_profiler_filename);
-PHP_FUNCTION(xdebug_dump_aggr_profiling_data);
-PHP_FUNCTION(xdebug_clear_aggr_profiling_data);
-
-/* misc functions */
-PHP_FUNCTION(xdebug_dump_superglobals);
-PHP_FUNCTION(xdebug_get_headers);
-#if HAVE_PHP_MEMORY_USAGE
-PHP_FUNCTION(xdebug_memory_usage);
-PHP_FUNCTION(xdebug_peak_memory_usage);
-#endif
-PHP_FUNCTION(xdebug_time_index);
-
-ZEND_BEGIN_MODULE_GLOBALS(xdebug)
- int status;
- int reason;
-
- long level;
- xdebug_llist *stack;
- long max_nesting_level;
- zend_bool default_enable;
- zend_bool collect_includes;
- long collect_params;
- zend_bool collect_return;
- zend_bool collect_vars;
- zend_bool collect_assignments;
- zend_bool extended_info;
- zend_bool show_ex_trace;
- zend_bool show_local_vars;
- zend_bool show_mem_delta;
- double start_time;
- HashTable *active_symbol_table;
- zend_execute_data *active_execute_data;
- zend_op_array *active_op_array;
- zval *This;
- function_stack_entry *active_fse;
- unsigned int prev_memory;
- char *file_link_format;
-
- zend_bool overload_var_dump;
- zend_bool var_dump_overloaded;
- void (*orig_var_dump_func)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_set_time_limit_func)(INTERNAL_FUNCTION_PARAMETERS);
-
- FILE *trace_file;
- zend_bool do_trace;
- zend_bool auto_trace;
- zend_bool trace_enable_trigger;
- char *trace_output_dir;
- char *trace_output_name;
- long trace_options;
- long trace_format;
- char *tracefile_name;
- char *last_exception_trace;
- char *last_eval_statement;
-
- /* variable dumping limitation settings */
- long display_max_children;
- long display_max_data;
- long display_max_depth;
-
- zend_bool cli_color;
- int output_is_tty;
-
- /* used for code coverage */
- zend_bool coverage_enable;
- zend_bool do_code_coverage;
- xdebug_hash *code_coverage;
- zend_bool code_coverage_unused;
- zend_bool code_coverage_dead_code_analysis;
- unsigned int function_count;
- int reserved_offset;
- char *previous_filename;
- xdebug_coverage_file *previous_file;
-
- /* used for collection errors */
- zend_bool do_collect_errors;
- xdebug_llist *collected_errors;
-
- /* superglobals */
- zend_bool dump_globals;
- zend_bool dump_once;
- zend_bool dump_undefined;
- zend_bool dumped;
- xdebug_llist server;
- xdebug_llist get;
- xdebug_llist post;
- xdebug_llist cookie;
- xdebug_llist files;
- xdebug_llist env;
- xdebug_llist request;
- xdebug_llist session;
-
- /* headers */
- xdebug_llist *headers;
-
- /* remote settings */
- zend_bool remote_enable; /* 0 */
- long remote_port; /* 9000 */
- char *remote_host; /* localhost */
- long remote_mode; /* XDEBUG_NONE, XDEBUG_JIT, XDEBUG_REQ */
- char *remote_handler; /* php3, gdb, dbgp */
- zend_bool remote_autostart; /* Disables the requirement for XDEBUG_SESSION_START */
- zend_bool remote_connect_back; /* connect back to the HTTP requestor */
- char *remote_log; /* Filename to log protocol communication to */
- FILE *remote_log_file; /* File handler for protocol log */
- long remote_cookie_expire_time; /* Expire time for the remote-session cookie */
-
- char *ide_key; /* As Xdebug uses it, from environment, USER, USERNAME or empty */
- char *ide_key_setting; /* Set through php.ini and friends */
-
- /* remote debugging globals */
- zend_bool remote_enabled;
- zend_bool breakpoints_allowed;
- xdebug_con context;
- unsigned int breakpoint_count;
- unsigned int no_exec;
-
- /* profiler settings */
- zend_bool profiler_enable;
- char *profiler_output_dir;
- char *profiler_output_name; /* "pid" or "crc32" */
- zend_bool profiler_enable_trigger;
- zend_bool profiler_append;
-
- /* profiler globals */
- zend_bool profiler_enabled;
- FILE *profile_file;
- char *profile_filename;
-
- /* DBGp globals */
- char *lastcmd;
- char *lasttransid;
-
- /* output redirection */
- int stdout_mode;
-
- /* aggregate profiling */
- HashTable aggr_calls;
- zend_bool profiler_aggregate;
-
- /* scream */
- zend_bool do_scream;
- zend_bool in_at;
-
- /* in-execution checking */
- zend_bool in_execution;
-ZEND_END_MODULE_GLOBALS(xdebug)
-
-#ifdef ZTS
-#define XG(v) TSRMG(xdebug_globals_id, zend_xdebug_globals *, v)
-#else
-#define XG(v) (xdebug_globals.v)
-#endif
-
-#endif
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * indent-tabs-mode: t
- * End:
- */
|
[-]
[+]
|
Deleted |
xdebug-2.2.4.tgz/xdebug-2.2.4/usefulstuff.c
^
|
@@ -1,696 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Xdebug |
- +----------------------------------------------------------------------+
- | Copyright (c) 2002-2013 Derick Rethans |
- +----------------------------------------------------------------------+
- | This source file is subject to version 1.0 of the Xdebug license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://xdebug.derickrethans.nl/license.php |
- | If you did not receive a copy of the Xdebug license and are unable |
- | to obtain it through the world-wide-web, please send a note to |
- | xdebug@derickrethans.nl so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@xdebug.org> |
- +----------------------------------------------------------------------+
- */
-
-#include <stdlib.h>
-#include <string.h>
-#ifndef WIN32
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/file.h>
-#else
-#define PATH_MAX MAX_PATH
-#include <winsock2.h>
-#include <io.h>
-#include "win32/time.h"
-#include <process.h>
-#endif
-#include "php_xdebug.h"
-#include "xdebug_mm.h"
-#include "xdebug_str.h"
-#include "usefulstuff.h"
-#include "ext/standard/php_lcg.h"
-#include "ext/standard/flock_compat.h"
-#include "main/php_ini.h"
-
-#ifndef NAME_MAX
-# ifdef _AIX
-# include <unistd.h>
-# define NAME_MAX pathconf("/dev/null",_PC_NAME_MAX)
-# else
-# define NAME_MAX (MAXNAMELEN-1)
-# endif
-#endif
-
-ZEND_EXTERN_MODULE_GLOBALS(xdebug)
-
-#define READ_BUFFER_SIZE 128
-
-char* xdebug_fd_read_line_delim(int socket, fd_buf *context, int type, unsigned char delim, int *length)
-{
- int size = 0, newl = 0, nbufsize = 0;
- char *tmp;
- char *tmp_buf = NULL;
- char *ptr;
- char buffer[READ_BUFFER_SIZE + 1];
-
- if (!context->buffer) {
- context->buffer = calloc(1,1);
- context->buffer_size = 0;
- }
-
- while (context->buffer_size < 1 || context->buffer[context->buffer_size - 1] != delim) {
- ptr = context->buffer + context->buffer_size;
- if (type == FD_RL_FILE) {
- newl = read(socket, buffer, READ_BUFFER_SIZE);
- } else {
- newl = recv(socket, buffer, READ_BUFFER_SIZE, 0);
- }
- if (newl > 0) {
- context->buffer = realloc(context->buffer, context->buffer_size + newl + 1);
- memcpy(context->buffer + context->buffer_size, buffer, newl);
- context->buffer_size += newl;
- context->buffer[context->buffer_size] = '\0';
- } else {
- return NULL;
- }
- }
-
- ptr = memchr(context->buffer, delim, context->buffer_size);
- size = ptr - context->buffer;
- /* Copy that line into tmp */
- tmp = malloc(size + 1);
- tmp[size] = '\0';
- memcpy(tmp, context->buffer, size);
- /* Rewrite existing buffer */
- if ((nbufsize = context->buffer_size - size - 1) > 0) {
- tmp_buf = malloc(nbufsize + 1);
- memcpy(tmp_buf, ptr + 1, nbufsize);
- tmp_buf[nbufsize] = 0;
- }
- free(context->buffer);
- context->buffer = tmp_buf;
- context->buffer_size = context->buffer_size - (size + 1);
-
- /* Return normal line */
- if (length) {
- *length = size;
- }
- return tmp;
-}
-
-char *xdebug_join(char *delim, xdebug_arg *args, int begin, int end)
-{
- int i;
- xdebug_str *ret;
-
- xdebug_str_ptr_init(ret);
- if (begin < 0) {
- begin = 0;
- }
- if (end > args->c - 1) {
- end = args->c - 1;
- }
- for (i = begin; i < end; i++) {
- xdebug_str_add(ret, args->args[i], 0);
- xdebug_str_add(ret, delim, 0);
- }
- xdebug_str_add(ret, args->args[end], 0);
- return ret->d;
-}
-
-void xdebug_explode(char *delim, char *str, xdebug_arg *args, int limit)
-{
- char *p1, *p2, *endp;
-
- endp = str + strlen(str);
-
- p1 = str;
- p2 = xdebug_memnstr(str, delim, strlen(delim), endp);
-
- if (p2 == NULL) {
- args->c++;
- args->args = (char**) xdrealloc(args->args, sizeof(char*) * args->c);
- args->args[args->c - 1] = (char*) xdmalloc(strlen(str) + 1);
- memcpy(args->args[args->c - 1], p1, strlen(str));
- args->args[args->c - 1][strlen(str)] = '\0';
- } else {
- do {
- args->c++;
- args->args = (char**) xdrealloc(args->args, sizeof(char*) * args->c);
- args->args[args->c - 1] = (char*) xdmalloc(p2 - p1 + 1);
- memcpy(args->args[args->c - 1], p1, p2 - p1);
- args->args[args->c - 1][p2 - p1] = '\0';
- p1 = p2 + strlen(delim);
- } while ((p2 = xdebug_memnstr(p1, delim, strlen(delim), endp)) != NULL && (limit == -1 || --limit > 1));
-
- if (p1 <= endp) {
- args->c++;
- args->args = (char**) xdrealloc(args->args, sizeof(char*) * args->c);
- args->args[args->c - 1] = (char*) xdmalloc(endp - p1 + 1);
- memcpy(args->args[args->c - 1], p1, endp - p1);
- args->args[args->c - 1][endp - p1] = '\0';
- }
- }
-}
-
-char* xdebug_memnstr(char *haystack, char *needle, int needle_len, char *end)
-{
- char *p = haystack;
- char first = *needle;
-
- /* let end point to the last character where needle may start */
- end -= needle_len;
-
- while (p <= end) {
- while (*p != first)
- if (++p > end)
- return NULL;
- if (memcmp(p, needle, needle_len) == 0)
- return p;
- p++;
- }
- return NULL;
-}
-
-double xdebug_get_utime(void)
-{
-#ifdef HAVE_GETTIMEOFDAY
- struct timeval tp;
- long sec = 0L;
- double msec = 0.0;
-
- if (gettimeofday((struct timeval *) &tp, NULL) == 0) {
- sec = tp.tv_sec;
- msec = (double) (tp.tv_usec / MICRO_IN_SEC);
-
- if (msec >= 1.0) {
- msec -= (long) msec;
- }
- return msec + sec;
- }
-#endif
- return 0;
-}
-
-char* xdebug_get_time(void)
-{
- time_t cur_time;
- char *str_time;
-
- str_time = xdmalloc(24);
- cur_time = time(NULL);
- strftime(str_time, 24, "%Y-%m-%d %H:%M:%S", gmtime (&cur_time));
- return str_time;
-}
-
-/* not all versions of php export this */
-static int xdebug_htoi(char *s)
-{
- int value;
- int c;
-
- c = s[0];
- if (isupper(c)) {
- c = tolower(c);
- }
- value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16;
-
- c = s[1];
- if (isupper(c)) {
- c = tolower(c);
- }
- value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10;
-
- return value;
-}
-
-/* not all versions of php export this */
-int xdebug_raw_url_decode(char *str, int len)
-{
- char *dest = str;
- char *data = str;
-
- while (len--) {
- if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) && isxdigit((int) *(data + 2))) {
- *dest = (char) xdebug_htoi(data + 1);
- data += 2;
- len -= 2;
- } else {
- *dest = *data;
- }
- data++;
- dest++;
- }
- *dest = '\0';
- return dest - str;
-}
-
-static unsigned char hexchars[] = "0123456789ABCDEF";
-
-char *xdebug_raw_url_encode(char const *s, int len, int *new_length, int skip_slash)
-{
- register int x, y;
- unsigned char *str;
-
- str = (unsigned char *) xdmalloc(3 * len + 1);
- for (x = 0, y = 0; len--; x++, y++) {
- str[y] = (unsigned char) s[x];
- if ((str[y] < '0' && str[y] != '-' && str[y] != '.' && (str[y] != '/' || !skip_slash)) ||
- (str[y] < 'A' && str[y] > '9' && str[y] != ':') ||
- (str[y] > 'Z' && str[y] < 'a' && str[y] != '_' && (str[y] != '\\' || !skip_slash)) ||
- (str[y] > 'z'))
- {
- str[y++] = '%';
- str[y++] = hexchars[(unsigned char) s[x] >> 4];
- str[y] = hexchars[(unsigned char) s[x] & 15];
- }
- }
- str[y] = '\0';
- if (new_length) {
- *new_length = y;
- }
- return ((char *) str);
-}
-
-/* fake URI's per IETF RFC 1738 and 2396 format */
-char *xdebug_path_from_url(const char *fileurl TSRMLS_DC)
-{
- /* deal with file: url's */
- char dfp[PATH_MAX * 2];
- const char *fp = dfp, *efp = fileurl;
-#ifdef PHP_WIN32
- int l = 0;
- int i;
-#endif
- char *tmp = NULL, *ret = NULL;;
-
- memset(dfp, 0, sizeof(dfp));
- strncpy(dfp, efp, sizeof(dfp) - 1);
- xdebug_raw_url_decode(dfp, strlen(dfp));
- tmp = strstr(fp, "file://");
-
- if (tmp) {
- fp = tmp + 7;
- if (fp[0] == '/' && fp[2] == ':') {
- fp++;
- }
- ret = xdstrdup(fp);
-#ifdef PHP_WIN32
- l = strlen(ret);
- /* convert '/' to '\' */
- for (i = 0; i < l; i++) {
- if (ret[i] == '/') {
- ret[i] = '\\';
- }
- }
-#endif
- } else {
- ret = xdstrdup(fileurl);
- }
-
- return ret;
-}
-
-#if PHP_VERSION_ID >= 50400
-# define VIRTUAL_FILE_EX_TSRMLS_CC TSRMLS_CC
-#else
-# define VIRTUAL_FILE_EX_TSRMLS_CC
-#endif
-
-/* fake URI's per IETF RFC 1738 and 2396 format */
-char *xdebug_path_to_url(const char *fileurl TSRMLS_DC)
-{
- int l, i, new_len;
- char *tmp = NULL;
- char *encoded_fileurl;
-
- /* encode the url */
- encoded_fileurl = xdebug_raw_url_encode(fileurl, strlen(fileurl), &new_len, 1);
-
- if (strncmp(fileurl, "phar://", 7) == 0) {
- /* ignore, phar is cool */
- tmp = xdstrdup(fileurl);
- } else if (fileurl[0] != '/' && fileurl[0] != '\\' && fileurl[1] != ':') {
- /* convert relative paths */
- cwd_state new_state;
- char cwd[MAXPATHLEN];
- char *result;
-
- result = VCWD_GETCWD(cwd, MAXPATHLEN);
- if (!result) {
- cwd[0] = '\0';
- }
-
- new_state.cwd = strdup(cwd);
- new_state.cwd_length = strlen(cwd);
-
- if (!virtual_file_ex(&new_state, fileurl, NULL, 1 VIRTUAL_FILE_EX_TSRMLS_CC)) {
- char *s = estrndup(new_state.cwd, new_state.cwd_length);
- tmp = xdebug_sprintf("file://%s",s);
- efree(s);
- }
- free(new_state.cwd);
-
- } else if (fileurl[1] == '/' || fileurl[1] == '\\') {
- /* convert UNC paths (eg. \\server\sharepath) */
- /* See http://blogs.msdn.com/ie/archive/2006/12/06/file-uris-in-windows.aspx */
- tmp = xdebug_sprintf("file:%s", encoded_fileurl);
- } else if (fileurl[0] == '/' || fileurl[0] == '\\') {
- /* convert *nix paths (eg. /path) */
- tmp = xdebug_sprintf("file://%s", encoded_fileurl);
- } else if (fileurl[1] == ':') {
- /* convert windows drive paths (eg. c:\path) */
- tmp = xdebug_sprintf("file:///%s", encoded_fileurl);
- } else {
- /* no clue about it, use it raw */
- tmp = xdstrdup(encoded_fileurl);
- }
- l = strlen(tmp);
- /* convert '\' to '/' */
- for (i = 0; i < l; i++) {
- if (tmp[i] == '\\') {
- tmp[i]='/';
- }
- }
- xdfree(encoded_fileurl);
- return tmp;
-}
-
-long xdebug_crc32(const char *string, int str_len)
-{
- unsigned int crc = ~0;
- int len;
-
- len = 0 ;
- for (len += str_len; str_len--; ++string) {
- XDEBUG_CRC32(crc, *string);
- }
- return ~crc;
-}
-
-#ifndef PHP_WIN32
-static FILE *xdebug_open_file(char *fname, char *mode, char *extension, char **new_fname)
-{
- FILE *fh;
- char *tmp_fname;
-
- if (extension) {
- tmp_fname = xdebug_sprintf("%s.%s", fname, extension);
- } else {
- tmp_fname = xdstrdup(fname);
- }
- fh = fopen(tmp_fname, mode);
- if (fh && new_fname) {
- *new_fname = tmp_fname;
- } else {
- xdfree(tmp_fname);
- }
- return fh;
-}
-
-static FILE *xdebug_open_file_with_random_ext(char *fname, char *mode, char *extension, char **new_fname)
-{
- FILE *fh;
- char *tmp_fname;
- TSRMLS_FETCH();
-
- if (extension) {
- tmp_fname = xdebug_sprintf("%s.%06x.%s", fname, (long) (1000000 * php_combined_lcg(TSRMLS_C)), extension);
- } else {
- tmp_fname = xdebug_sprintf("%s.%06x", fname, (long) (1000000 * php_combined_lcg(TSRMLS_C)), extension);
- }
- fh = fopen(tmp_fname, mode);
- if (fh && new_fname) {
- *new_fname = tmp_fname;
- } else {
- xdfree(tmp_fname);
- }
- return fh;
-}
-
-FILE *xdebug_fopen(char *fname, char *mode, char *extension, char **new_fname)
-{
- int r;
- FILE *fh;
- struct stat buf;
- char *tmp_fname = NULL;
- int filename_len = 0;
-
- /* We're not doing any tricks for append mode... as that has atomic writes
- * anyway. And we ignore read mode as well. */
- if (mode[0] == 'a' || mode[0] == 'r') {
- return xdebug_open_file(fname, mode, extension, new_fname);
- }
-
- /* Make sure we don't open a file with a path that's too long */
- filename_len += (fname ? strlen(fname) : 0); /* filename */
- filename_len += (extension ? strlen(extension) : 0) + 1; /* extension (+ ".") */
- filename_len += 8; /* possible random extension (+ ".") */
- if (filename_len > NAME_MAX) {
- fname[NAME_MAX - (extension ? strlen(extension) : 0 )] = '\0';
- }
-
- /* In write mode however we do have to do some stuff. */
- /* 1. Check if the file exists */
- if (extension) {
- tmp_fname = xdebug_sprintf("%s.%s", fname, extension);
- } else {
- tmp_fname = xdstrdup(fname);
- }
- r = stat(tmp_fname, &buf);
- /* We're not freeing "tmp_fname" as that is used in the freopen as well. */
-
- if (r == -1) {
- /* 2. Cool, the file doesn't exist so we can open it without probs now. */
- fh = xdebug_open_file(fname, "w", extension, new_fname);
- goto lock;
- }
-
- /* 3. It exists, check if we can open it. */
- fh = xdebug_open_file(fname, "r+", extension, new_fname);
- if (!fh) {
- /* 4. If fh == null we couldn't even open the file, so open a new one with a new name */
- fh = xdebug_open_file_with_random_ext(fname, "w", extension, new_fname);
- goto lock;
- }
-
- /* 5. It exists and we can open it, check if we can exclusively lock it. */
- r = flock(fileno(fh), LOCK_EX | LOCK_NB);
- if (r == -1) {
- if (errno == EWOULDBLOCK) {
- fclose(fh);
- /* 6. The file is in use, so we open one with a new name. */
- fh = xdebug_open_file_with_random_ext(fname, "w", extension, new_fname);
- goto lock;
- }
- }
-
- /* 7. We established a lock, now we truncate and return the handle */
- fh = freopen(tmp_fname, "w", fh);
-
-lock: /* Yes yes, an evil goto label here!!! */
- if (fh) {
- /* 8. We have to lock again after the reopen as that basically closes
- * the file and opens it again. There is a small race condition here...
- */
- flock(fileno(fh), LOCK_EX | LOCK_NB);
- }
- xdfree(tmp_fname);
- return fh;
-}
-#else
-FILE *xdebug_fopen(char *fname, char *mode, char *extension, char **new_fname)
-{
- char *tmp_fname;
- FILE *ret;
-
- if (extension) {
- tmp_fname = xdebug_sprintf("%s.%s", fname, extension);
- } else {
- tmp_fname = xdstrdup(fname);
- }
- ret = fopen(tmp_fname, mode);
- if (new_fname) {
- *new_fname = tmp_fname;
- } else {
- xdfree(tmp_fname);
- }
- return ret;
-}
-#endif
-
-int xdebug_format_output_filename(char **filename, char *format, char *script_name)
-{
- xdebug_str fname = {0, 0, NULL};
- char cwd[128];
- TSRMLS_FETCH();
-
- while (*format)
- {
- if (*format != '%') {
- xdebug_str_addl(&fname, (char *) format, 1, 0);
- } else {
- format++;
- switch (*format)
- {
- case 'c': /* crc32 of the current working directory */
- if (VCWD_GETCWD(cwd, 127)) {
- xdebug_str_add(&fname, xdebug_sprintf("%lu", xdebug_crc32(cwd, strlen(cwd))), 1);
- }
- break;
-
- case 'p': /* pid */
- xdebug_str_add(&fname, xdebug_sprintf("%ld", getpid()), 1);
- break;
-
- case 'r': /* random number */
- xdebug_str_add(&fname, xdebug_sprintf("%06x", (long) (1000000 * php_combined_lcg(TSRMLS_C))), 1);
- break;
-
- case 's': { /* script fname */
- char *char_ptr, *script_name_tmp;
-
- /* we do not always have script_name available, so if we
- * don't have it and this format specifier is used then we
- * simple do nothing for this specifier */
- if (!script_name) {
- break;
- }
-
- /* create a copy to work on */
- script_name_tmp = xdstrdup(script_name);
-
- /* replace slashes, whitespace and colons with underscores */
- while ((char_ptr = strpbrk(script_name_tmp, "/\\: ")) != NULL) {
- char_ptr[0] = '_';
- }
- /* replace .php with _php */
- char_ptr = strrchr(script_name_tmp, '.');
- if (char_ptr) {
- char_ptr[0] = '_';
- }
- xdebug_str_add(&fname, script_name_tmp, 0);
- xdfree(script_name_tmp);
- } break;
-
- case 't': { /* timestamp (in seconds) */
- time_t the_time = time(NULL);
- xdebug_str_add(&fname, xdebug_sprintf("%ld", the_time), 1);
- } break;
-
- case 'u': { /* timestamp (in microseconds) */
- char *char_ptr, *utime = xdebug_sprintf("%f", xdebug_get_utime());
-
- /* Replace . with _ (or should it be nuked?) */
- char_ptr = strrchr(utime, '.');
- if (char_ptr) {
- char_ptr[0] = '_';
- }
- xdebug_str_add(&fname, utime, 1);
- } break;
-
- case 'H': /* $_SERVER['HTTP_HOST'] */
- case 'U': /* $_SERVER['UNIQUE_ID'] */
- case 'R': { /* $_SERVER['REQUEST_URI'] */
- zval **data;
- char *char_ptr, *strval;
- int retval = FAILURE;
-
- if (PG(http_globals)[TRACK_VARS_SERVER]) {
- switch (*format) {
- case 'H':
- retval = zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_HOST", sizeof("HTTP_HOST"), (void **) &data);
- break;
- case 'R':
- retval = zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &data);
- break;
- case 'U':
- retval = zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "UNIQUE_ID", sizeof("UNIQUE_ID"), (void **) &data);
- break;
- }
-
- if (retval == SUCCESS) {
- strval = estrdup(Z_STRVAL_PP(data));
-
- /* replace slashes, dots, question marks, plus
- * signs, ampersands, spaces and other evil chars
- * with underscores */
- while ((char_ptr = strpbrk(strval, "/\\.?&+:*\"<>| ")) != NULL) {
- char_ptr[0] = '_';
- }
- xdebug_str_add(&fname, strval, 0);
- efree(strval);
- }
- }
- } break;
-
- case 'S': { /* session id */
- zval **data;
- char *char_ptr, *strval;
- char *sess_name;
-
- sess_name = zend_ini_string("session.name", sizeof("session.name"), 0);
-
- if (sess_name && PG(http_globals)[TRACK_VARS_COOKIE] &&
- zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), sess_name, strlen(sess_name) + 1, (void **) &data) == SUCCESS &&
- Z_STRLEN_PP(data) < 100 /* Prevent any unrealistically long data being set as filename */
- ) {
- strval = estrdup(Z_STRVAL_PP(data));
-
- /* replace slashes, dots, question marks, plus signs,
- * ampersands and spaces with underscores */
- while ((char_ptr = strpbrk(strval, "/\\.?&+ ")) != NULL) {
- char_ptr[0] = '_';
- }
- xdebug_str_add(&fname, strval, 0);
- efree(strval);
- }
- } break;
-
- case '%': /* literal % */
- xdebug_str_addl(&fname, "%", 1, 0);
- break;
- }
- }
- format++;
- }
-
- *filename = fname.d;
-
- return fname.l;
-}
-
-void xdebug_open_log(TSRMLS_D)
-{
- /* initialize remote log file */
- XG(remote_log_file) = NULL;
- if (XG(remote_log) && strlen(XG(remote_log))) {
- XG(remote_log_file) = xdebug_fopen(XG(remote_log), "a", NULL, NULL);
- }
- if (XG(remote_log_file)) {
- char *timestr = xdebug_get_time();
- fprintf(XG(remote_log_file), "Log opened at %s\n", timestr);
- fflush(XG(remote_log_file));
- xdfree(timestr);
- }
-}
-
-void xdebug_close_log(TSRMLS_D)
-{
- if (XG(remote_log_file)) {
- char *timestr = xdebug_get_time();
- fprintf(XG(remote_log_file), "Log closed at %s\n\n", timestr);
- fflush(XG(remote_log_file));
- xdfree(timestr);
- fclose(XG(remote_log_file));
- XG(remote_log_file) = NULL;
- }
-}
|
[-]
[+]
|
Deleted |
xdebug-2.2.4.tgz/xdebug-2.2.4/xdebug_com.c
^
|
@@ -1,180 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Xdebug |
- +----------------------------------------------------------------------+
- | Copyright (c) 2002-2013 Derick Rethans |
- +----------------------------------------------------------------------+
- | This source file is subject to version 1.0 of the Xdebug license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://xdebug.derickrethans.nl/license.php |
- | If you did not receive a copy of the Xdebug license and are unable |
- | to obtain it through the world-wide-web, please send a note to |
- | xdebug@derickrethans.nl so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@xdebug.org> |
- +----------------------------------------------------------------------+
- */
-
-
-#include <string.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#ifndef PHP_WIN32
-#include <unistd.h>
-#endif
-
-#ifdef PHP_WIN32
-# include <process.h>
-# include <direct.h>
-# include "win32/time.h"
-#define PATH_MAX MAX_PATH
-#else
-# include <sys/socket.h>
-# include <netinet/in.h>
-# include <netinet/tcp.h>
-# include <arpa/inet.h>
-# include <netdb.h>
-#endif
-
-#include "xdebug_com.h"
-
-#ifdef PHP_WIN32
-int inet_aton(const char *cp, struct in_addr *inp)
-{
- inp->s_addr = inet_addr(cp);
- if (inp->s_addr == INADDR_NONE) {
- return 0;
- }
- return 1;
-}
-#endif
-
-/*
- * Converts a host name to an IP address. */
-static int lookup_hostname(const char *addr, struct in_addr *in)
-{
- struct hostent *host_info;
-
- if (!inet_aton(addr, in)) {
- host_info = gethostbyname(addr);
- if (host_info == 0) {
- /* Error: unknown host */
- return -1;
- }
- *in = *((struct in_addr *) host_info->h_addr);
- }
- return 0;
-}
-/* }}} */
-
-int xdebug_create_socket(const char *hostname, int dport)
-{
- struct sockaddr sa;
- struct sockaddr_in address;
- int sockfd;
- int status;
- struct timeval timeout;
- int actually_connected;
- socklen_t size;
-#if WIN32|WINNT
- WORD wVersionRequested;
- WSADATA wsaData;
- char optval = 1;
- const char yes = 1;
- u_long no = 0;
-
- wVersionRequested = MAKEWORD(2, 2);
- WSAStartup(wVersionRequested, &wsaData);
-#else
- long optval = 1;
-#endif
- memset(&address, 0, sizeof(address));
- lookup_hostname(hostname, &address.sin_addr);
- address.sin_family = AF_INET;
- address.sin_port = htons((unsigned short)dport);
-
- sockfd = socket(address.sin_family, SOCK_STREAM, 0);
- if (sockfd == SOCK_ERR) {
-#ifndef DEBUGGER_FAIL_SILENTLY
-#if WIN32|WINNT
- printf("create_debugger_socket(\"%s\", %d) socket: %d\n",
- hostname, dport, WSAGetLastError());
-#else
- printf("create_debugger_socket(\"%s\", %d) socket: %s\n",
- hostname, dport, strerror(errno));
-#endif
-#endif
- return -1;
- }
-
- /* Put socket in non-blocking mode so we can use select for timeouts */
- timeout.tv_sec = 0;
- timeout.tv_usec = 200000;
-
-#ifdef WIN32
- ioctlsocket(sockfd, FIONBIO, (u_long*)&yes);
-#else
- fcntl(sockfd, F_SETFL, O_NONBLOCK);
-#endif
-
- /* connect */
- status = connect(sockfd, (struct sockaddr*)&address, sizeof(address));
- if (status < 0) {
-#ifdef WIN32
- errno = WSAGetLastError();
- if (errno != WSAEINPROGRESS && errno != WSAEWOULDBLOCK) {
-#else
- if (errno != EINPROGRESS) {
-#endif
- return -1;
- }
-
- while (1) {
- fd_set rset, wset, eset;
-
- FD_ZERO(&rset);
- FD_SET(sockfd, &rset);
- FD_ZERO(&wset);
- FD_SET(sockfd, &wset);
- FD_ZERO(&eset);
- FD_SET(sockfd, &eset);
-
- if (select(sockfd+1, &rset, &wset, &eset, &timeout) == 0) {
- return -2;
- }
-
- /* if our descriptor has an error */
- if (FD_ISSET(sockfd, &eset)) {
- return -1;
- }
-
- /* if our descriptor is ready break out */
- if (FD_ISSET(sockfd, &wset) || FD_ISSET(sockfd, &rset)) {
- break;
- }
- }
-
- actually_connected = getpeername(sockfd, &sa, &size);
- if (actually_connected == -1) {
- return -1;
- }
- }
-
-
-#ifdef WIN32
- ioctlsocket(sockfd, FIONBIO, &no);
-#else
- fcntl(sockfd, F_SETFL, 0);
-#endif
-
- setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof(optval));
- return sockfd;
-}
-
-void xdebug_close_socket(int socket)
-{
- SCLOSE(socket);
-}
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/package.xml
^
|
@@ -25,11 +25,11 @@
<email>derick@xdebug.org</email>
<active>yes</active>
</lead>
- <date>2014-02-28</date>
- <time>16:05:14</time>
+ <date>2014-04-29</date>
+ <time>20:06:07</time>
<version>
- <release>2.2.4</release>
- <api>2.2.4</api>
+ <release>2.2.5</release>
+ <api>2.2.5</api>
</version>
<stability>
<release>stable</release>
@@ -37,16 +37,12 @@
</stability>
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD style</license>
<notes>
-Fri, Feb 28, 2014 - xdebug 2.2.4
+Tue, Apr 29, 2014 - xdebug 2.2.5
= Fixed bugs:
- - Fixed bug #785: Profiler does not handle closures and call_user_func_array well.
- - Fixed bug #963: Xdebug waits too long for response from remote client
- - Fixed bug #976: XDebug crashes if current varibles scope contains COM object.
- - Fixed bug #978: Inspection of array with negative keys fails
- - Fixed bug #979: property_value -m 0 should mean all bytes, not 0 bytes
- - Fixed bug #987: Hidden property names not shown.
+ - Fixed bug #1040: Fixed uninitialized sa value.
+ - Fixed building on hurd-i386.
</notes>
<contents>
<dir name="/">
@@ -84,14 +80,14 @@
<file md5sum="e8b4e74da6a51c13062ffc2352cd15ab" name="Makefile.frag" role="src" />
<file md5sum="491aea9e7732f8a60a426964acb8c3ed" name="Makefile.in" role="src" />
<file md5sum="1ec94a996ad186351d816f41ba650d56" name="NEWS" role="doc" />
- <file md5sum="06f3f2624e2b4cbecd9eeb899bbb0301" name="php_xdebug.h" role="src" />
+ <file md5sum="8c8fca8be0cb078b537e14acbb6236b5" name="php_xdebug.h" role="src" />
<file md5sum="7f8447778bee8fd16353ebdbe1577db1" name="README" role="doc" />
- <file md5sum="1a738b3f979ef33e1135bf4538182b20" name="usefulstuff.c" role="src" />
+ <file md5sum="f9e0415a56ba05054ba906b7ac41885d" name="usefulstuff.c" role="src" />
<file md5sum="6dd7df83205deabeb18fccc1828f4aeb" name="usefulstuff.h" role="src" />
<file md5sum="135baf1aaa7dd4da7ad92ee5b5662139" name="xdebug.c" role="src" />
<file md5sum="14b911bdbe89f2efbf0d629f860b9ad2" name="xdebug_code_coverage.c" role="src" />
<file md5sum="c133e8cd5b7c2d651526612797907d08" name="xdebug_code_coverage.h" role="src" />
- <file md5sum="0d9389f2b1852d83b697826a75230c95" name="xdebug_com.c" role="src" />
+ <file md5sum="3bedb4b3f0f995d11ff859d8ef95d55c" name="xdebug_com.c" role="src" />
<file md5sum="548e4f096d9d3bd1a930356a7b59c0b2" name="xdebug_com.h" role="src" />
<file md5sum="5861f516acf2cae8ccea80fe77e30eb3" name="xdebug_compat.c" role="src" />
<file md5sum="30cb3d6e0103aa02297ea5afb4fb3fc0" name="xdebug_compat.h" role="src" />
@@ -138,6 +134,31 @@
<zendextsrcrelease />
<changelog>
<release>
+ <date>2014-02-28</date>
+ <time>10:33:00</time>
+ <version>
+ <release>2.2.4</release>
+ <api>2.2.4</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD style</license>
+ <notes>
+Fri, Feb 28, 2014 - xdebug 2.2.4
+
+= Fixed bugs:
+
+ - Fixed bug #785: Profiler does not handle closures and call_user_func_array well.
+ - Fixed bug #963: Xdebug waits too long for response from remote client
+ - Fixed bug #976: XDebug crashes if current varibles scope contains COM object.
+ - Fixed bug #978: Inspection of array with negative keys fails
+ - Fixed bug #979: property_value -m 0 should mean all bytes, not 0 bytes
+ - Fixed bug #987: Hidden property names not shown.
+ </notes>
+ </release>
+ <release>
<date>2013-05-22</date>
<time>08:54:00</time>
<version>
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/CREDITS
^
|
(renamed from xdebug-2.2.4/CREDITS)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/CREDITS
^
|
(renamed from xdebug-2.2.4/CREDITS)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/LICENSE
^
|
(renamed from xdebug-2.2.4/LICENSE)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/LICENSE
^
|
(renamed from xdebug-2.2.4/LICENSE)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/Makefile.frag
^
|
(renamed from xdebug-2.2.4/Makefile.frag)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/Makefile.frag
^
|
(renamed from xdebug-2.2.4/Makefile.frag)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/Makefile.in
^
|
(renamed from xdebug-2.2.4/Makefile.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/Makefile.in
^
|
(renamed from xdebug-2.2.4/Makefile.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/NEWS
^
|
(renamed from xdebug-2.2.4/NEWS)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/NEWS
^
|
(renamed from xdebug-2.2.4/NEWS)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/README
^
|
(renamed from xdebug-2.2.4/README)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/README
^
|
(renamed from xdebug-2.2.4/README)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/config.m4
^
|
(renamed from xdebug-2.2.4/config.m4)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/config.m4
^
|
(renamed from xdebug-2.2.4/config.m4)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/config.w32
^
|
(renamed from xdebug-2.2.4/config.w32)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/config.w32
^
|
(renamed from xdebug-2.2.4/config.w32)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/contrib/tracefile-analyser.php
^
|
(renamed from xdebug-2.2.4/contrib/tracefile-analyser.php)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/contrib/tracefile-analyser.php
^
|
(renamed from xdebug-2.2.4/contrib/tracefile-analyser.php)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/contrib/xt.vim
^
|
(renamed from xdebug-2.2.4/contrib/xt.vim)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/contrib/xt.vim
^
|
(renamed from xdebug-2.2.4/contrib/xt.vim)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/INSTALL
^
|
(renamed from xdebug-2.2.4/debugclient/INSTALL)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/INSTALL
^
|
(renamed from xdebug-2.2.4/debugclient/INSTALL)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/LICENSE
^
|
(renamed from xdebug-2.2.4/debugclient/LICENSE)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/LICENSE
^
|
(renamed from xdebug-2.2.4/debugclient/LICENSE)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/Makefile.in
^
|
(renamed from xdebug-2.2.4/debugclient/Makefile.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/Makefile.in
^
|
(renamed from xdebug-2.2.4/debugclient/Makefile.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/acinclude.m4
^
|
(renamed from xdebug-2.2.4/debugclient/acinclude.m4)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/acinclude.m4
^
|
(renamed from xdebug-2.2.4/debugclient/acinclude.m4)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/buildcheck.sh
^
|
(renamed from xdebug-2.2.4/debugclient/build/buildcheck.sh)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/buildcheck.sh
^
|
(renamed from xdebug-2.2.4/debugclient/build/buildcheck.sh)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/buildconf1.mk
^
|
(renamed from xdebug-2.2.4/debugclient/build/buildconf1.mk)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/buildconf1.mk
^
|
(renamed from xdebug-2.2.4/debugclient/build/buildconf1.mk)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/buildconf2.mk
^
|
(renamed from xdebug-2.2.4/debugclient/build/buildconf2.mk)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/buildconf2.mk
^
|
(renamed from xdebug-2.2.4/debugclient/build/buildconf2.mk)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/clean.mk
^
|
(renamed from xdebug-2.2.4/debugclient/build/clean.mk)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/clean.mk
^
|
(renamed from xdebug-2.2.4/debugclient/build/clean.mk)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/config-stubs
^
|
(renamed from xdebug-2.2.4/debugclient/build/config-stubs)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/build/config-stubs
^
|
(renamed from xdebug-2.2.4/debugclient/build/config-stubs)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/buildconf
^
|
(renamed from xdebug-2.2.4/debugclient/buildconf)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/buildconf
^
|
(renamed from xdebug-2.2.4/debugclient/buildconf)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/config.guess
^
|
(renamed from xdebug-2.2.4/debugclient/config.guess)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/config.guess
^
|
(renamed from xdebug-2.2.4/debugclient/config.guess)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/config.h.in
^
|
(renamed from xdebug-2.2.4/debugclient/config.h.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/config.h.in
^
|
(renamed from xdebug-2.2.4/debugclient/config.h.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/config.sub
^
|
(renamed from xdebug-2.2.4/debugclient/config.sub)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/config.sub
^
|
(renamed from xdebug-2.2.4/debugclient/config.sub)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/configure
^
|
(renamed from xdebug-2.2.4/debugclient/configure)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/configure
^
|
(renamed from xdebug-2.2.4/debugclient/configure)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/configure.in
^
|
(renamed from xdebug-2.2.4/debugclient/configure.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/configure.in
^
|
(renamed from xdebug-2.2.4/debugclient/configure.in)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/cvsclean
^
|
(renamed from xdebug-2.2.4/debugclient/cvsclean)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/cvsclean
^
|
(renamed from xdebug-2.2.4/debugclient/cvsclean)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/debugclient.dsp
^
|
(renamed from xdebug-2.2.4/debugclient/debugclient.dsp)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/debugclient.dsp
^
|
(renamed from xdebug-2.2.4/debugclient/debugclient.dsp)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/depcomp
^
|
(renamed from xdebug-2.2.4/debugclient/depcomp)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/depcomp
^
|
(renamed from xdebug-2.2.4/debugclient/depcomp)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/install-sh
^
|
(renamed from xdebug-2.2.4/debugclient/install-sh)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/install-sh
^
|
(renamed from xdebug-2.2.4/debugclient/install-sh)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/ltmain.sh
^
|
(renamed from xdebug-2.2.4/debugclient/ltmain.sh)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/ltmain.sh
^
|
(renamed from xdebug-2.2.4/debugclient/ltmain.sh)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/main.c
^
|
(renamed from xdebug-2.2.4/debugclient/main.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/main.c
^
|
(renamed from xdebug-2.2.4/debugclient/main.c)
|
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/missing
^
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/mkinstalldirs
^
|
(renamed from xdebug-2.2.4/debugclient/mkinstalldirs)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/mkinstalldirs
^
|
(renamed from xdebug-2.2.4/debugclient/mkinstalldirs)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/usefulstuff.c
^
|
(renamed from xdebug-2.2.4/debugclient/usefulstuff.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/usefulstuff.c
^
|
(renamed from xdebug-2.2.4/debugclient/usefulstuff.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/usefulstuff.h
^
|
(renamed from xdebug-2.2.4/debugclient/usefulstuff.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/debugclient/usefulstuff.h
^
|
(renamed from xdebug-2.2.4/debugclient/usefulstuff.h)
|
[-]
[+]
|
Added |
xdebug-2.2.5.tgz/xdebug-2.2.5/php_xdebug.h
^
|
@@ -0,0 +1,293 @@
+/*
+ +----------------------------------------------------------------------+
+ | Xdebug |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2002-2013 Derick Rethans |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 1.0 of the Xdebug license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available at through the world-wide-web at |
+ | http://xdebug.derickrethans.nl/license.php |
+ | If you did not receive a copy of the Xdebug license and are unable |
+ | to obtain it through the world-wide-web, please send a note to |
+ | xdebug@derickrethans.nl so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Derick Rethans <derick@xdebug.org> |
+ +----------------------------------------------------------------------+
+ */
+
+#ifndef PHP_XDEBUG_H
+#define PHP_XDEBUG_H
+
+#define XDEBUG_NAME "Xdebug"
+#define XDEBUG_VERSION "2.2.5"
+#define XDEBUG_AUTHOR "Derick Rethans"
+#define XDEBUG_COPYRIGHT "Copyright (c) 2002-2014 by Derick Rethans"
+#define XDEBUG_COPYRIGHT_SHORT "Copyright (c) 2002-2014"
+#define XDEBUG_URL "http://xdebug.org"
+#define XDEBUG_URL_FAQ "http://xdebug.org/docs/faq#api"
+
+#include "php.h"
+
+#include "xdebug_handlers.h"
+#include "xdebug_hash.h"
+#include "xdebug_llist.h"
+#include "xdebug_code_coverage.h"
+
+extern zend_module_entry xdebug_module_entry;
+#define phpext_xdebug_ptr &xdebug_module_entry
+
+#define MICRO_IN_SEC 1000000.00
+
+#define OUTPUT_NOT_CHECKED -1
+#define OUTPUT_IS_TTY 1
+#define OUTPUT_NOT_TTY 0
+
+#ifdef PHP_WIN32
+#define PHP_XDEBUG_API __declspec(dllexport)
+#else
+#define PHP_XDEBUG_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#include "main/SAPI.h"
+
+#if MEMORY_LIMIT
+# define HAVE_PHP_MEMORY_USAGE 1
+#elif PHP_VERSION_ID >= 50201
+# define HAVE_PHP_MEMORY_USAGE 1
+#else
+# define HAVE_PHP_MEMORY_USAGE 0
+#endif
+
+#if PHP_VERSION_ID >= 50200
+# define XG_MEMORY_USAGE() zend_memory_usage(0 TSRMLS_CC)
+# define XG_MEMORY_PEAK_USAGE() zend_memory_peak_usage(0 TSRMLS_CC)
+#else
+# define XG_MEMORY_USAGE() AG(allocated_memory)
+# define XG_MEMORY_PEAK_USAGE() AG(allocated_memory_peak)
+#endif
+
+#if PHP_VERSION_ID >= 50300
+# define XG_SAPI_HEADER_OP_DC , sapi_header_op_enum op
+# define XG_SAPI_HEADER_OP_CC , op
+#else
+# define XG_SAPI_HEADER_OP_DC
+# define XG_SAPI_HEADER_OP_CC
+#endif
+
+PHP_MINIT_FUNCTION(xdebug);
+PHP_MSHUTDOWN_FUNCTION(xdebug);
+PHP_RINIT_FUNCTION(xdebug);
+PHP_RSHUTDOWN_FUNCTION(xdebug);
+PHP_MINFO_FUNCTION(xdebug);
+ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xdebug);
+
+#ifndef PHP_WIN32
+int xdebug_is_output_tty();
+#endif
+
+/* call stack functions */
+PHP_FUNCTION(xdebug_get_stack_depth);
+PHP_FUNCTION(xdebug_get_function_stack);
+PHP_FUNCTION(xdebug_get_formatted_function_stack);
+PHP_FUNCTION(xdebug_print_function_stack);
+PHP_FUNCTION(xdebug_get_declared_vars);
+PHP_FUNCTION(xdebug_call_class);
+PHP_FUNCTION(xdebug_call_function);
+PHP_FUNCTION(xdebug_call_file);
+PHP_FUNCTION(xdebug_call_line);
+
+PHP_FUNCTION(xdebug_set_time_limit);
+
+PHP_FUNCTION(xdebug_var_dump);
+PHP_FUNCTION(xdebug_debug_zval);
+PHP_FUNCTION(xdebug_debug_zval_stdout);
+
+/* activation functions */
+PHP_FUNCTION(xdebug_enable);
+PHP_FUNCTION(xdebug_disable);
+PHP_FUNCTION(xdebug_is_enabled);
+
+/* breaking functions */
+PHP_FUNCTION(xdebug_break);
+
+/* tracing functions */
+PHP_FUNCTION(xdebug_start_trace);
+PHP_FUNCTION(xdebug_stop_trace);
+PHP_FUNCTION(xdebug_get_tracefile_name);
+
+/* error collecting functions */
+PHP_FUNCTION(xdebug_start_error_collection);
+PHP_FUNCTION(xdebug_stop_error_collection);
+PHP_FUNCTION(xdebug_get_collected_errors);
+
+/* profiling functions */
+PHP_FUNCTION(xdebug_get_profiler_filename);
+PHP_FUNCTION(xdebug_dump_aggr_profiling_data);
+PHP_FUNCTION(xdebug_clear_aggr_profiling_data);
+
+/* misc functions */
+PHP_FUNCTION(xdebug_dump_superglobals);
+PHP_FUNCTION(xdebug_get_headers);
+#if HAVE_PHP_MEMORY_USAGE
+PHP_FUNCTION(xdebug_memory_usage);
+PHP_FUNCTION(xdebug_peak_memory_usage);
+#endif
+PHP_FUNCTION(xdebug_time_index);
+
+ZEND_BEGIN_MODULE_GLOBALS(xdebug)
+ int status;
+ int reason;
+
+ long level;
+ xdebug_llist *stack;
+ long max_nesting_level;
+ zend_bool default_enable;
+ zend_bool collect_includes;
+ long collect_params;
+ zend_bool collect_return;
+ zend_bool collect_vars;
+ zend_bool collect_assignments;
+ zend_bool extended_info;
+ zend_bool show_ex_trace;
+ zend_bool show_local_vars;
+ zend_bool show_mem_delta;
+ double start_time;
+ HashTable *active_symbol_table;
+ zend_execute_data *active_execute_data;
+ zend_op_array *active_op_array;
+ zval *This;
+ function_stack_entry *active_fse;
+ unsigned int prev_memory;
+ char *file_link_format;
+
+ zend_bool overload_var_dump;
+ zend_bool var_dump_overloaded;
+ void (*orig_var_dump_func)(INTERNAL_FUNCTION_PARAMETERS);
+ void (*orig_set_time_limit_func)(INTERNAL_FUNCTION_PARAMETERS);
+
+ FILE *trace_file;
+ zend_bool do_trace;
+ zend_bool auto_trace;
+ zend_bool trace_enable_trigger;
+ char *trace_output_dir;
+ char *trace_output_name;
+ long trace_options;
+ long trace_format;
+ char *tracefile_name;
+ char *last_exception_trace;
+ char *last_eval_statement;
+
+ /* variable dumping limitation settings */
+ long display_max_children;
+ long display_max_data;
+ long display_max_depth;
+
+ zend_bool cli_color;
+ int output_is_tty;
+
+ /* used for code coverage */
+ zend_bool coverage_enable;
+ zend_bool do_code_coverage;
+ xdebug_hash *code_coverage;
+ zend_bool code_coverage_unused;
+ zend_bool code_coverage_dead_code_analysis;
+ unsigned int function_count;
+ int reserved_offset;
+ char *previous_filename;
+ xdebug_coverage_file *previous_file;
+
+ /* used for collection errors */
+ zend_bool do_collect_errors;
+ xdebug_llist *collected_errors;
+
+ /* superglobals */
+ zend_bool dump_globals;
+ zend_bool dump_once;
+ zend_bool dump_undefined;
+ zend_bool dumped;
+ xdebug_llist server;
+ xdebug_llist get;
+ xdebug_llist post;
+ xdebug_llist cookie;
+ xdebug_llist files;
+ xdebug_llist env;
+ xdebug_llist request;
+ xdebug_llist session;
+
+ /* headers */
+ xdebug_llist *headers;
+
+ /* remote settings */
+ zend_bool remote_enable; /* 0 */
+ long remote_port; /* 9000 */
+ char *remote_host; /* localhost */
+ long remote_mode; /* XDEBUG_NONE, XDEBUG_JIT, XDEBUG_REQ */
+ char *remote_handler; /* php3, gdb, dbgp */
+ zend_bool remote_autostart; /* Disables the requirement for XDEBUG_SESSION_START */
+ zend_bool remote_connect_back; /* connect back to the HTTP requestor */
+ char *remote_log; /* Filename to log protocol communication to */
+ FILE *remote_log_file; /* File handler for protocol log */
+ long remote_cookie_expire_time; /* Expire time for the remote-session cookie */
+
+ char *ide_key; /* As Xdebug uses it, from environment, USER, USERNAME or empty */
+ char *ide_key_setting; /* Set through php.ini and friends */
+
+ /* remote debugging globals */
+ zend_bool remote_enabled;
+ zend_bool breakpoints_allowed;
+ xdebug_con context;
+ unsigned int breakpoint_count;
+ unsigned int no_exec;
+
+ /* profiler settings */
+ zend_bool profiler_enable;
+ char *profiler_output_dir;
+ char *profiler_output_name; /* "pid" or "crc32" */
+ zend_bool profiler_enable_trigger;
+ zend_bool profiler_append;
+
+ /* profiler globals */
+ zend_bool profiler_enabled;
+ FILE *profile_file;
+ char *profile_filename;
+
+ /* DBGp globals */
+ char *lastcmd;
+ char *lasttransid;
+
+ /* output redirection */
+ int stdout_mode;
+
+ /* aggregate profiling */
+ HashTable aggr_calls;
+ zend_bool profiler_aggregate;
+
+ /* scream */
+ zend_bool do_scream;
+ zend_bool in_at;
+
+ /* in-execution checking */
+ zend_bool in_execution;
+ZEND_END_MODULE_GLOBALS(xdebug)
+
+#ifdef ZTS
+#define XG(v) TSRMG(xdebug_globals_id, zend_xdebug_globals *, v)
+#else
+#define XG(v) (xdebug_globals.v)
+#endif
+
+#endif
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
|
[-]
[+]
|
Added |
xdebug-2.2.5.tgz/xdebug-2.2.5/usefulstuff.c
^
|
@@ -0,0 +1,697 @@
+/*
+ +----------------------------------------------------------------------+
+ | Xdebug |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2002-2013 Derick Rethans |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 1.0 of the Xdebug license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available at through the world-wide-web at |
+ | http://xdebug.derickrethans.nl/license.php |
+ | If you did not receive a copy of the Xdebug license and are unable |
+ | to obtain it through the world-wide-web, please send a note to |
+ | xdebug@derickrethans.nl so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Derick Rethans <derick@xdebug.org> |
+ +----------------------------------------------------------------------+
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#ifndef WIN32
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/file.h>
+#else
+#define PATH_MAX MAX_PATH
+#include <winsock2.h>
+#include <io.h>
+#include "win32/time.h"
+#include <process.h>
+#endif
+#include "php_xdebug.h"
+#include "xdebug_mm.h"
+#include "xdebug_str.h"
+#include "usefulstuff.h"
+#include "ext/standard/php_lcg.h"
+#include "ext/standard/flock_compat.h"
+#include "main/php_ini.h"
+
+#ifndef NAME_MAX
+# ifdef _AIX
+# include <unistd.h>
+# define NAME_MAX pathconf("/dev/null",_PC_NAME_MAX)
+# else
+# define NAME_MAX (MAXNAMELEN-1)
+# endif
+#endif
+
+ZEND_EXTERN_MODULE_GLOBALS(xdebug)
+
+#define READ_BUFFER_SIZE 128
+
+char* xdebug_fd_read_line_delim(int socket, fd_buf *context, int type, unsigned char delim, int *length)
+{
+ int size = 0, newl = 0, nbufsize = 0;
+ char *tmp;
+ char *tmp_buf = NULL;
+ char *ptr;
+ char buffer[READ_BUFFER_SIZE + 1];
+
+ if (!context->buffer) {
+ context->buffer = calloc(1,1);
+ context->buffer_size = 0;
+ }
+
+ while (context->buffer_size < 1 || context->buffer[context->buffer_size - 1] != delim) {
+ ptr = context->buffer + context->buffer_size;
+ if (type == FD_RL_FILE) {
+ newl = read(socket, buffer, READ_BUFFER_SIZE);
+ } else {
+ newl = recv(socket, buffer, READ_BUFFER_SIZE, 0);
+ }
+ if (newl > 0) {
+ context->buffer = realloc(context->buffer, context->buffer_size + newl + 1);
+ memcpy(context->buffer + context->buffer_size, buffer, newl);
+ context->buffer_size += newl;
+ context->buffer[context->buffer_size] = '\0';
+ } else {
+ return NULL;
+ }
+ }
+
+ ptr = memchr(context->buffer, delim, context->buffer_size);
+ size = ptr - context->buffer;
+ /* Copy that line into tmp */
+ tmp = malloc(size + 1);
+ tmp[size] = '\0';
+ memcpy(tmp, context->buffer, size);
+ /* Rewrite existing buffer */
+ if ((nbufsize = context->buffer_size - size - 1) > 0) {
+ tmp_buf = malloc(nbufsize + 1);
+ memcpy(tmp_buf, ptr + 1, nbufsize);
+ tmp_buf[nbufsize] = 0;
+ }
+ free(context->buffer);
+ context->buffer = tmp_buf;
+ context->buffer_size = context->buffer_size - (size + 1);
+
+ /* Return normal line */
+ if (length) {
+ *length = size;
+ }
+ return tmp;
+}
+
+char *xdebug_join(char *delim, xdebug_arg *args, int begin, int end)
+{
+ int i;
+ xdebug_str *ret;
+
+ xdebug_str_ptr_init(ret);
+ if (begin < 0) {
+ begin = 0;
+ }
+ if (end > args->c - 1) {
+ end = args->c - 1;
+ }
+ for (i = begin; i < end; i++) {
+ xdebug_str_add(ret, args->args[i], 0);
+ xdebug_str_add(ret, delim, 0);
+ }
+ xdebug_str_add(ret, args->args[end], 0);
+ return ret->d;
+}
+
+void xdebug_explode(char *delim, char *str, xdebug_arg *args, int limit)
+{
+ char *p1, *p2, *endp;
+
+ endp = str + strlen(str);
+
+ p1 = str;
+ p2 = xdebug_memnstr(str, delim, strlen(delim), endp);
+
+ if (p2 == NULL) {
+ args->c++;
+ args->args = (char**) xdrealloc(args->args, sizeof(char*) * args->c);
+ args->args[args->c - 1] = (char*) xdmalloc(strlen(str) + 1);
+ memcpy(args->args[args->c - 1], p1, strlen(str));
+ args->args[args->c - 1][strlen(str)] = '\0';
+ } else {
+ do {
+ args->c++;
+ args->args = (char**) xdrealloc(args->args, sizeof(char*) * args->c);
+ args->args[args->c - 1] = (char*) xdmalloc(p2 - p1 + 1);
+ memcpy(args->args[args->c - 1], p1, p2 - p1);
+ args->args[args->c - 1][p2 - p1] = '\0';
+ p1 = p2 + strlen(delim);
+ } while ((p2 = xdebug_memnstr(p1, delim, strlen(delim), endp)) != NULL && (limit == -1 || --limit > 1));
+
+ if (p1 <= endp) {
+ args->c++;
+ args->args = (char**) xdrealloc(args->args, sizeof(char*) * args->c);
+ args->args[args->c - 1] = (char*) xdmalloc(endp - p1 + 1);
+ memcpy(args->args[args->c - 1], p1, endp - p1);
+ args->args[args->c - 1][endp - p1] = '\0';
+ }
+ }
+}
+
+char* xdebug_memnstr(char *haystack, char *needle, int needle_len, char *end)
+{
+ char *p = haystack;
+ char first = *needle;
+
+ /* let end point to the last character where needle may start */
+ end -= needle_len;
+
+ while (p <= end) {
+ while (*p != first)
+ if (++p > end)
+ return NULL;
+ if (memcmp(p, needle, needle_len) == 0)
+ return p;
+ p++;
+ }
+ return NULL;
+}
+
+double xdebug_get_utime(void)
+{
+#ifdef HAVE_GETTIMEOFDAY
+ struct timeval tp;
+ long sec = 0L;
+ double msec = 0.0;
+
+ if (gettimeofday((struct timeval *) &tp, NULL) == 0) {
+ sec = tp.tv_sec;
+ msec = (double) (tp.tv_usec / MICRO_IN_SEC);
+
+ if (msec >= 1.0) {
+ msec -= (long) msec;
+ }
+ return msec + sec;
+ }
+#endif
+ return 0;
+}
+
+char* xdebug_get_time(void)
+{
+ time_t cur_time;
+ char *str_time;
+
+ str_time = xdmalloc(24);
+ cur_time = time(NULL);
+ strftime(str_time, 24, "%Y-%m-%d %H:%M:%S", gmtime (&cur_time));
+ return str_time;
+}
+
+/* not all versions of php export this */
+static int xdebug_htoi(char *s)
+{
+ int value;
+ int c;
+
+ c = s[0];
+ if (isupper(c)) {
+ c = tolower(c);
+ }
+ value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16;
+
+ c = s[1];
+ if (isupper(c)) {
+ c = tolower(c);
+ }
+ value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10;
+
+ return value;
+}
+
+/* not all versions of php export this */
+int xdebug_raw_url_decode(char *str, int len)
+{
+ char *dest = str;
+ char *data = str;
+
+ while (len--) {
+ if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) && isxdigit((int) *(data + 2))) {
+ *dest = (char) xdebug_htoi(data + 1);
+ data += 2;
+ len -= 2;
+ } else {
+ *dest = *data;
+ }
+ data++;
+ dest++;
+ }
+ *dest = '\0';
+ return dest - str;
+}
+
+static unsigned char hexchars[] = "0123456789ABCDEF";
+
+char *xdebug_raw_url_encode(char const *s, int len, int *new_length, int skip_slash)
+{
+ register int x, y;
+ unsigned char *str;
+
+ str = (unsigned char *) xdmalloc(3 * len + 1);
+ for (x = 0, y = 0; len--; x++, y++) {
+ str[y] = (unsigned char) s[x];
+ if ((str[y] < '0' && str[y] != '-' && str[y] != '.' && (str[y] != '/' || !skip_slash)) ||
+ (str[y] < 'A' && str[y] > '9' && str[y] != ':') ||
+ (str[y] > 'Z' && str[y] < 'a' && str[y] != '_' && (str[y] != '\\' || !skip_slash)) ||
+ (str[y] > 'z'))
+ {
+ str[y++] = '%';
+ str[y++] = hexchars[(unsigned char) s[x] >> 4];
+ str[y] = hexchars[(unsigned char) s[x] & 15];
+ }
+ }
+ str[y] = '\0';
+ if (new_length) {
+ *new_length = y;
+ }
+ return ((char *) str);
+}
+
+/* fake URI's per IETF RFC 1738 and 2396 format */
+char *xdebug_path_from_url(const char *fileurl TSRMLS_DC)
+{
+ /* deal with file: url's */
+ char *dfp = NULL;
+ const char *fp = NULL, *efp = fileurl;
+#ifdef PHP_WIN32
+ int l = 0;
+ int i;
+#endif
+ char *tmp = NULL, *ret = NULL;
+
+ dfp = xdstrdup(efp);
+ fp = dfp;
+ xdebug_raw_url_decode(dfp, strlen(dfp));
+ tmp = strstr(fp, "file://");
+
+ if (tmp) {
+ fp = tmp + 7;
+ if (fp[0] == '/' && fp[2] == ':') {
+ fp++;
+ }
+ ret = xdstrdup(fp);
+#ifdef PHP_WIN32
+ l = strlen(ret);
+ /* convert '/' to '\' */
+ for (i = 0; i < l; i++) {
+ if (ret[i] == '/') {
+ ret[i] = '\\';
+ }
+ }
+#endif
+ } else {
+ ret = xdstrdup(fileurl);
+ }
+
+ free(dfp);
+ return ret;
+}
+
+#if PHP_VERSION_ID >= 50400
+# define VIRTUAL_FILE_EX_TSRMLS_CC TSRMLS_CC
+#else
+# define VIRTUAL_FILE_EX_TSRMLS_CC
+#endif
+
+/* fake URI's per IETF RFC 1738 and 2396 format */
+char *xdebug_path_to_url(const char *fileurl TSRMLS_DC)
+{
+ int l, i, new_len;
+ char *tmp = NULL;
+ char *encoded_fileurl;
+
+ /* encode the url */
+ encoded_fileurl = xdebug_raw_url_encode(fileurl, strlen(fileurl), &new_len, 1);
+
+ if (strncmp(fileurl, "phar://", 7) == 0) {
+ /* ignore, phar is cool */
+ tmp = xdstrdup(fileurl);
+ } else if (fileurl[0] != '/' && fileurl[0] != '\\' && fileurl[1] != ':') {
+ /* convert relative paths */
+ cwd_state new_state;
+ char cwd[MAXPATHLEN];
+ char *result;
+
+ result = VCWD_GETCWD(cwd, MAXPATHLEN);
+ if (!result) {
+ cwd[0] = '\0';
+ }
+
+ new_state.cwd = strdup(cwd);
+ new_state.cwd_length = strlen(cwd);
+
+ if (!virtual_file_ex(&new_state, fileurl, NULL, 1 VIRTUAL_FILE_EX_TSRMLS_CC)) {
+ char *s = estrndup(new_state.cwd, new_state.cwd_length);
+ tmp = xdebug_sprintf("file://%s",s);
+ efree(s);
+ }
+ free(new_state.cwd);
+
+ } else if (fileurl[1] == '/' || fileurl[1] == '\\') {
+ /* convert UNC paths (eg. \\server\sharepath) */
+ /* See http://blogs.msdn.com/ie/archive/2006/12/06/file-uris-in-windows.aspx */
+ tmp = xdebug_sprintf("file:%s", encoded_fileurl);
+ } else if (fileurl[0] == '/' || fileurl[0] == '\\') {
+ /* convert *nix paths (eg. /path) */
+ tmp = xdebug_sprintf("file://%s", encoded_fileurl);
+ } else if (fileurl[1] == ':') {
+ /* convert windows drive paths (eg. c:\path) */
+ tmp = xdebug_sprintf("file:///%s", encoded_fileurl);
+ } else {
+ /* no clue about it, use it raw */
+ tmp = xdstrdup(encoded_fileurl);
+ }
+ l = strlen(tmp);
+ /* convert '\' to '/' */
+ for (i = 0; i < l; i++) {
+ if (tmp[i] == '\\') {
+ tmp[i]='/';
+ }
+ }
+ xdfree(encoded_fileurl);
+ return tmp;
+}
+
+long xdebug_crc32(const char *string, int str_len)
+{
+ unsigned int crc = ~0;
+ int len;
+
+ len = 0 ;
+ for (len += str_len; str_len--; ++string) {
+ XDEBUG_CRC32(crc, *string);
+ }
+ return ~crc;
+}
+
+#ifndef PHP_WIN32
+static FILE *xdebug_open_file(char *fname, char *mode, char *extension, char **new_fname)
+{
+ FILE *fh;
+ char *tmp_fname;
+
+ if (extension) {
+ tmp_fname = xdebug_sprintf("%s.%s", fname, extension);
+ } else {
+ tmp_fname = xdstrdup(fname);
+ }
+ fh = fopen(tmp_fname, mode);
+ if (fh && new_fname) {
+ *new_fname = tmp_fname;
+ } else {
+ xdfree(tmp_fname);
+ }
+ return fh;
+}
+
+static FILE *xdebug_open_file_with_random_ext(char *fname, char *mode, char *extension, char **new_fname)
+{
+ FILE *fh;
+ char *tmp_fname;
+ TSRMLS_FETCH();
+
+ if (extension) {
+ tmp_fname = xdebug_sprintf("%s.%06x.%s", fname, (long) (1000000 * php_combined_lcg(TSRMLS_C)), extension);
+ } else {
+ tmp_fname = xdebug_sprintf("%s.%06x", fname, (long) (1000000 * php_combined_lcg(TSRMLS_C)), extension);
+ }
+ fh = fopen(tmp_fname, mode);
+ if (fh && new_fname) {
+ *new_fname = tmp_fname;
+ } else {
+ xdfree(tmp_fname);
+ }
+ return fh;
+}
+
+FILE *xdebug_fopen(char *fname, char *mode, char *extension, char **new_fname)
+{
+ int r;
+ FILE *fh;
+ struct stat buf;
+ char *tmp_fname = NULL;
+ int filename_len = 0;
+
+ /* We're not doing any tricks for append mode... as that has atomic writes
+ * anyway. And we ignore read mode as well. */
+ if (mode[0] == 'a' || mode[0] == 'r') {
+ return xdebug_open_file(fname, mode, extension, new_fname);
+ }
+
+ /* Make sure we don't open a file with a path that's too long */
+ filename_len += (fname ? strlen(fname) : 0); /* filename */
+ filename_len += (extension ? strlen(extension) : 0) + 1; /* extension (+ ".") */
+ filename_len += 8; /* possible random extension (+ ".") */
+ if (filename_len > NAME_MAX) {
+ fname[NAME_MAX - (extension ? strlen(extension) : 0 )] = '\0';
+ }
+
+ /* In write mode however we do have to do some stuff. */
+ /* 1. Check if the file exists */
+ if (extension) {
+ tmp_fname = xdebug_sprintf("%s.%s", fname, extension);
+ } else {
+ tmp_fname = xdstrdup(fname);
+ }
+ r = stat(tmp_fname, &buf);
+ /* We're not freeing "tmp_fname" as that is used in the freopen as well. */
+
+ if (r == -1) {
+ /* 2. Cool, the file doesn't exist so we can open it without probs now. */
+ fh = xdebug_open_file(fname, "w", extension, new_fname);
+ goto lock;
+ }
+
+ /* 3. It exists, check if we can open it. */
+ fh = xdebug_open_file(fname, "r+", extension, new_fname);
+ if (!fh) {
+ /* 4. If fh == null we couldn't even open the file, so open a new one with a new name */
+ fh = xdebug_open_file_with_random_ext(fname, "w", extension, new_fname);
+ goto lock;
+ }
+
+ /* 5. It exists and we can open it, check if we can exclusively lock it. */
+ r = flock(fileno(fh), LOCK_EX | LOCK_NB);
+ if (r == -1) {
+ if (errno == EWOULDBLOCK) {
+ fclose(fh);
+ /* 6. The file is in use, so we open one with a new name. */
+ fh = xdebug_open_file_with_random_ext(fname, "w", extension, new_fname);
+ goto lock;
+ }
+ }
+
+ /* 7. We established a lock, now we truncate and return the handle */
+ fh = freopen(tmp_fname, "w", fh);
+
+lock: /* Yes yes, an evil goto label here!!! */
+ if (fh) {
+ /* 8. We have to lock again after the reopen as that basically closes
+ * the file and opens it again. There is a small race condition here...
+ */
+ flock(fileno(fh), LOCK_EX | LOCK_NB);
+ }
+ xdfree(tmp_fname);
+ return fh;
+}
+#else
+FILE *xdebug_fopen(char *fname, char *mode, char *extension, char **new_fname)
+{
+ char *tmp_fname;
+ FILE *ret;
+
+ if (extension) {
+ tmp_fname = xdebug_sprintf("%s.%s", fname, extension);
+ } else {
+ tmp_fname = xdstrdup(fname);
+ }
+ ret = fopen(tmp_fname, mode);
+ if (new_fname) {
+ *new_fname = tmp_fname;
+ } else {
+ xdfree(tmp_fname);
+ }
+ return ret;
+}
+#endif
+
+int xdebug_format_output_filename(char **filename, char *format, char *script_name)
+{
+ xdebug_str fname = {0, 0, NULL};
+ char cwd[128];
+ TSRMLS_FETCH();
+
+ while (*format)
+ {
+ if (*format != '%') {
+ xdebug_str_addl(&fname, (char *) format, 1, 0);
+ } else {
+ format++;
+ switch (*format)
+ {
+ case 'c': /* crc32 of the current working directory */
+ if (VCWD_GETCWD(cwd, 127)) {
+ xdebug_str_add(&fname, xdebug_sprintf("%lu", xdebug_crc32(cwd, strlen(cwd))), 1);
+ }
+ break;
+
+ case 'p': /* pid */
+ xdebug_str_add(&fname, xdebug_sprintf("%ld", getpid()), 1);
+ break;
+
+ case 'r': /* random number */
+ xdebug_str_add(&fname, xdebug_sprintf("%06x", (long) (1000000 * php_combined_lcg(TSRMLS_C))), 1);
+ break;
+
+ case 's': { /* script fname */
+ char *char_ptr, *script_name_tmp;
+
+ /* we do not always have script_name available, so if we
+ * don't have it and this format specifier is used then we
+ * simple do nothing for this specifier */
+ if (!script_name) {
+ break;
+ }
+
+ /* create a copy to work on */
+ script_name_tmp = xdstrdup(script_name);
+
+ /* replace slashes, whitespace and colons with underscores */
+ while ((char_ptr = strpbrk(script_name_tmp, "/\\: ")) != NULL) {
+ char_ptr[0] = '_';
+ }
+ /* replace .php with _php */
+ char_ptr = strrchr(script_name_tmp, '.');
+ if (char_ptr) {
+ char_ptr[0] = '_';
+ }
+ xdebug_str_add(&fname, script_name_tmp, 0);
+ xdfree(script_name_tmp);
+ } break;
+
+ case 't': { /* timestamp (in seconds) */
+ time_t the_time = time(NULL);
+ xdebug_str_add(&fname, xdebug_sprintf("%ld", the_time), 1);
+ } break;
+
+ case 'u': { /* timestamp (in microseconds) */
+ char *char_ptr, *utime = xdebug_sprintf("%f", xdebug_get_utime());
+
+ /* Replace . with _ (or should it be nuked?) */
+ char_ptr = strrchr(utime, '.');
+ if (char_ptr) {
+ char_ptr[0] = '_';
+ }
+ xdebug_str_add(&fname, utime, 1);
+ } break;
+
+ case 'H': /* $_SERVER['HTTP_HOST'] */
+ case 'U': /* $_SERVER['UNIQUE_ID'] */
+ case 'R': { /* $_SERVER['REQUEST_URI'] */
+ zval **data;
+ char *char_ptr, *strval;
+ int retval = FAILURE;
+
+ if (PG(http_globals)[TRACK_VARS_SERVER]) {
+ switch (*format) {
+ case 'H':
+ retval = zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_HOST", sizeof("HTTP_HOST"), (void **) &data);
+ break;
+ case 'R':
+ retval = zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &data);
+ break;
+ case 'U':
+ retval = zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "UNIQUE_ID", sizeof("UNIQUE_ID"), (void **) &data);
+ break;
+ }
+
+ if (retval == SUCCESS) {
+ strval = estrdup(Z_STRVAL_PP(data));
+
+ /* replace slashes, dots, question marks, plus
+ * signs, ampersands, spaces and other evil chars
+ * with underscores */
+ while ((char_ptr = strpbrk(strval, "/\\.?&+:*\"<>| ")) != NULL) {
+ char_ptr[0] = '_';
+ }
+ xdebug_str_add(&fname, strval, 0);
+ efree(strval);
+ }
+ }
+ } break;
+
+ case 'S': { /* session id */
+ zval **data;
+ char *char_ptr, *strval;
+ char *sess_name;
+
+ sess_name = zend_ini_string("session.name", sizeof("session.name"), 0);
+
+ if (sess_name && PG(http_globals)[TRACK_VARS_COOKIE] &&
+ zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), sess_name, strlen(sess_name) + 1, (void **) &data) == SUCCESS &&
+ Z_STRLEN_PP(data) < 100 /* Prevent any unrealistically long data being set as filename */
+ ) {
+ strval = estrdup(Z_STRVAL_PP(data));
+
+ /* replace slashes, dots, question marks, plus signs,
+ * ampersands and spaces with underscores */
+ while ((char_ptr = strpbrk(strval, "/\\.?&+ ")) != NULL) {
+ char_ptr[0] = '_';
+ }
+ xdebug_str_add(&fname, strval, 0);
+ efree(strval);
+ }
+ } break;
+
+ case '%': /* literal % */
+ xdebug_str_addl(&fname, "%", 1, 0);
+ break;
+ }
+ }
+ format++;
+ }
+
+ *filename = fname.d;
+
+ return fname.l;
+}
+
+void xdebug_open_log(TSRMLS_D)
+{
+ /* initialize remote log file */
+ XG(remote_log_file) = NULL;
+ if (XG(remote_log) && strlen(XG(remote_log))) {
+ XG(remote_log_file) = xdebug_fopen(XG(remote_log), "a", NULL, NULL);
+ }
+ if (XG(remote_log_file)) {
+ char *timestr = xdebug_get_time();
+ fprintf(XG(remote_log_file), "Log opened at %s\n", timestr);
+ fflush(XG(remote_log_file));
+ xdfree(timestr);
+ }
+}
+
+void xdebug_close_log(TSRMLS_D)
+{
+ if (XG(remote_log_file)) {
+ char *timestr = xdebug_get_time();
+ fprintf(XG(remote_log_file), "Log closed at %s\n\n", timestr);
+ fflush(XG(remote_log_file));
+ xdfree(timestr);
+ fclose(XG(remote_log_file));
+ XG(remote_log_file) = NULL;
+ }
+}
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/usefulstuff.h
^
|
(renamed from xdebug-2.2.4/usefulstuff.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/usefulstuff.h
^
|
(renamed from xdebug-2.2.4/usefulstuff.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug.c
^
|
(renamed from xdebug-2.2.4/xdebug.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug.c
^
|
(renamed from xdebug-2.2.4/xdebug.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_code_coverage.c
^
|
(renamed from xdebug-2.2.4/xdebug_code_coverage.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_code_coverage.c
^
|
(renamed from xdebug-2.2.4/xdebug_code_coverage.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_code_coverage.h
^
|
(renamed from xdebug-2.2.4/xdebug_code_coverage.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_code_coverage.h
^
|
(renamed from xdebug-2.2.4/xdebug_code_coverage.h)
|
[-]
[+]
|
Added |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_com.c
^
|
@@ -0,0 +1,180 @@
+/*
+ +----------------------------------------------------------------------+
+ | Xdebug |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2002-2013 Derick Rethans |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 1.0 of the Xdebug license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available at through the world-wide-web at |
+ | http://xdebug.derickrethans.nl/license.php |
+ | If you did not receive a copy of the Xdebug license and are unable |
+ | to obtain it through the world-wide-web, please send a note to |
+ | xdebug@derickrethans.nl so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Derick Rethans <derick@xdebug.org> |
+ +----------------------------------------------------------------------+
+ */
+
+
+#include <string.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <stdio.h>
+#include <fcntl.h>
+#ifndef PHP_WIN32
+#include <unistd.h>
+#endif
+
+#ifdef PHP_WIN32
+# include <process.h>
+# include <direct.h>
+# include "win32/time.h"
+#define PATH_MAX MAX_PATH
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+# include <arpa/inet.h>
+# include <netdb.h>
+#endif
+
+#include "xdebug_com.h"
+
+#ifdef PHP_WIN32
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+ inp->s_addr = inet_addr(cp);
+ if (inp->s_addr == INADDR_NONE) {
+ return 0;
+ }
+ return 1;
+}
+#endif
+
+/*
+ * Converts a host name to an IP address. */
+static int lookup_hostname(const char *addr, struct in_addr *in)
+{
+ struct hostent *host_info;
+
+ if (!inet_aton(addr, in)) {
+ host_info = gethostbyname(addr);
+ if (host_info == 0) {
+ /* Error: unknown host */
+ return -1;
+ }
+ *in = *((struct in_addr *) host_info->h_addr);
+ }
+ return 0;
+}
+/* }}} */
+
+int xdebug_create_socket(const char *hostname, int dport)
+{
+ struct sockaddr sa;
+ struct sockaddr_in address;
+ int sockfd;
+ int status;
+ struct timeval timeout;
+ int actually_connected;
+ socklen_t size = sizeof(sa);
+#if WIN32|WINNT
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ char optval = 1;
+ const char yes = 1;
+ u_long no = 0;
+
+ wVersionRequested = MAKEWORD(2, 2);
+ WSAStartup(wVersionRequested, &wsaData);
+#else
+ long optval = 1;
+#endif
+ memset(&address, 0, sizeof(address));
+ lookup_hostname(hostname, &address.sin_addr);
+ address.sin_family = AF_INET;
+ address.sin_port = htons((unsigned short)dport);
+
+ sockfd = socket(address.sin_family, SOCK_STREAM, 0);
+ if (sockfd == SOCK_ERR) {
+#ifndef DEBUGGER_FAIL_SILENTLY
+#if WIN32|WINNT
+ printf("create_debugger_socket(\"%s\", %d) socket: %d\n",
+ hostname, dport, WSAGetLastError());
+#else
+ printf("create_debugger_socket(\"%s\", %d) socket: %s\n",
+ hostname, dport, strerror(errno));
+#endif
+#endif
+ return -1;
+ }
+
+ /* Put socket in non-blocking mode so we can use select for timeouts */
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 200000;
+
+#ifdef WIN32
+ ioctlsocket(sockfd, FIONBIO, (u_long*)&yes);
+#else
+ fcntl(sockfd, F_SETFL, O_NONBLOCK);
+#endif
+
+ /* connect */
+ status = connect(sockfd, (struct sockaddr*)&address, sizeof(address));
+ if (status < 0) {
+#ifdef WIN32
+ errno = WSAGetLastError();
+ if (errno != WSAEINPROGRESS && errno != WSAEWOULDBLOCK) {
+#else
+ if (errno != EINPROGRESS) {
+#endif
+ return -1;
+ }
+
+ while (1) {
+ fd_set rset, wset, eset;
+
+ FD_ZERO(&rset);
+ FD_SET(sockfd, &rset);
+ FD_ZERO(&wset);
+ FD_SET(sockfd, &wset);
+ FD_ZERO(&eset);
+ FD_SET(sockfd, &eset);
+
+ if (select(sockfd+1, &rset, &wset, &eset, &timeout) == 0) {
+ return -2;
+ }
+
+ /* if our descriptor has an error */
+ if (FD_ISSET(sockfd, &eset)) {
+ return -1;
+ }
+
+ /* if our descriptor is ready break out */
+ if (FD_ISSET(sockfd, &wset) || FD_ISSET(sockfd, &rset)) {
+ break;
+ }
+ }
+
+ actually_connected = getpeername(sockfd, &sa, &size);
+ if (actually_connected == -1) {
+ return -1;
+ }
+ }
+
+
+#ifdef WIN32
+ ioctlsocket(sockfd, FIONBIO, &no);
+#else
+ fcntl(sockfd, F_SETFL, 0);
+#endif
+
+ setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof(optval));
+ return sockfd;
+}
+
+void xdebug_close_socket(int socket)
+{
+ SCLOSE(socket);
+}
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_com.h
^
|
(renamed from xdebug-2.2.4/xdebug_com.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_com.h
^
|
(renamed from xdebug-2.2.4/xdebug_com.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_compat.c
^
|
(renamed from xdebug-2.2.4/xdebug_compat.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_compat.c
^
|
(renamed from xdebug-2.2.4/xdebug_compat.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_compat.h
^
|
(renamed from xdebug-2.2.4/xdebug_compat.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_compat.h
^
|
(renamed from xdebug-2.2.4/xdebug_compat.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handler_dbgp.c
^
|
(renamed from xdebug-2.2.4/xdebug_handler_dbgp.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handler_dbgp.c
^
|
(renamed from xdebug-2.2.4/xdebug_handler_dbgp.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handler_dbgp.h
^
|
(renamed from xdebug-2.2.4/xdebug_handler_dbgp.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handler_dbgp.h
^
|
(renamed from xdebug-2.2.4/xdebug_handler_dbgp.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handlers.c
^
|
(renamed from xdebug-2.2.4/xdebug_handlers.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handlers.c
^
|
(renamed from xdebug-2.2.4/xdebug_handlers.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handlers.h
^
|
(renamed from xdebug-2.2.4/xdebug_handlers.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_handlers.h
^
|
(renamed from xdebug-2.2.4/xdebug_handlers.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_hash.c
^
|
(renamed from xdebug-2.2.4/xdebug_hash.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_hash.c
^
|
(renamed from xdebug-2.2.4/xdebug_hash.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_hash.h
^
|
(renamed from xdebug-2.2.4/xdebug_hash.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_hash.h
^
|
(renamed from xdebug-2.2.4/xdebug_hash.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_llist.c
^
|
(renamed from xdebug-2.2.4/xdebug_llist.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_llist.c
^
|
(renamed from xdebug-2.2.4/xdebug_llist.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_llist.h
^
|
(renamed from xdebug-2.2.4/xdebug_llist.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_llist.h
^
|
(renamed from xdebug-2.2.4/xdebug_llist.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_mm.h
^
|
(renamed from xdebug-2.2.4/xdebug_mm.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_mm.h
^
|
(renamed from xdebug-2.2.4/xdebug_mm.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_private.c
^
|
(renamed from xdebug-2.2.4/xdebug_private.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_private.c
^
|
(renamed from xdebug-2.2.4/xdebug_private.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_private.h
^
|
(renamed from xdebug-2.2.4/xdebug_private.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_private.h
^
|
(renamed from xdebug-2.2.4/xdebug_private.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_profiler.c
^
|
(renamed from xdebug-2.2.4/xdebug_profiler.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_profiler.c
^
|
(renamed from xdebug-2.2.4/xdebug_profiler.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_profiler.h
^
|
(renamed from xdebug-2.2.4/xdebug_profiler.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_profiler.h
^
|
(renamed from xdebug-2.2.4/xdebug_profiler.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_set.c
^
|
(renamed from xdebug-2.2.4/xdebug_set.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_set.c
^
|
(renamed from xdebug-2.2.4/xdebug_set.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_set.h
^
|
(renamed from xdebug-2.2.4/xdebug_set.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_set.h
^
|
(renamed from xdebug-2.2.4/xdebug_set.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_stack.c
^
|
(renamed from xdebug-2.2.4/xdebug_stack.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_stack.c
^
|
(renamed from xdebug-2.2.4/xdebug_stack.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_stack.h
^
|
(renamed from xdebug-2.2.4/xdebug_stack.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_stack.h
^
|
(renamed from xdebug-2.2.4/xdebug_stack.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_str.c
^
|
(renamed from xdebug-2.2.4/xdebug_str.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_str.c
^
|
(renamed from xdebug-2.2.4/xdebug_str.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_str.h
^
|
(renamed from xdebug-2.2.4/xdebug_str.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_str.h
^
|
(renamed from xdebug-2.2.4/xdebug_str.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_superglobals.c
^
|
(renamed from xdebug-2.2.4/xdebug_superglobals.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_superglobals.c
^
|
(renamed from xdebug-2.2.4/xdebug_superglobals.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_superglobals.h
^
|
(renamed from xdebug-2.2.4/xdebug_superglobals.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_superglobals.h
^
|
(renamed from xdebug-2.2.4/xdebug_superglobals.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_tracing.c
^
|
(renamed from xdebug-2.2.4/xdebug_tracing.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_tracing.c
^
|
(renamed from xdebug-2.2.4/xdebug_tracing.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_tracing.h
^
|
(renamed from xdebug-2.2.4/xdebug_tracing.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_tracing.h
^
|
(renamed from xdebug-2.2.4/xdebug_tracing.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_var.c
^
|
(renamed from xdebug-2.2.4/xdebug_var.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_var.c
^
|
(renamed from xdebug-2.2.4/xdebug_var.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_var.h
^
|
(renamed from xdebug-2.2.4/xdebug_var.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_var.h
^
|
(renamed from xdebug-2.2.4/xdebug_var.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_xml.c
^
|
(renamed from xdebug-2.2.4/xdebug_xml.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_xml.c
^
|
(renamed from xdebug-2.2.4/xdebug_xml.c)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_xml.h
^
|
(renamed from xdebug-2.2.4/xdebug_xml.h)
|
[-]
[+]
|
Changed |
xdebug-2.2.5.tgz/xdebug-2.2.5/xdebug_xml.h
^
|
(renamed from xdebug-2.2.4/xdebug_xml.h)
|