Changeset 1353 for TI05-delivery/trunk
- Timestamp:
- 03/08/06 10:35:04 (14 years ago)
- Location:
- TI05-delivery/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_log.c
r1334 r1353 71 71 fprintf(logfh, "\n"); 72 72 } 73 73 fflush(logfh); 74 74 75 va_end(ap); 75 76 -
TI05-delivery/trunk/src/python_ext/bbftpd.c
r1332 r1353 64 64 * failure rather than error. 65 65 */ 66 if ((authzHandler = PyObject_CallMethod(authHandler, "authenticate", "")) == NULL) {66 if ((authzHandler = PyObject_CallMethod(authHandler, "authenticate", NULL)) == NULL) { 67 67 ndg_pyerr_to_logmessage(logmessage, "ndg_auth"); 68 68 return -1; … … 243 243 PyObject *ret; 244 244 245 ndg_debug_sleep(15); 246 245 247 if (!PyArg_ParseTuple(args, "")) { 246 248 return NULL; … … 260 262 ret = Py_BuildValue("s#", buffer, len); 261 263 free(buffer); 264 262 265 return ret; 263 266 } … … 270 273 static PyObject *pybbftpd_run(PyObject *self, PyObject *args) { 271 274 int argc, i; 272 char **argv, **arg_p ;275 char **argv, **arg_p, *p; 273 276 int pid; 274 277 char preargs[2][20] = { "bbftpd_embedded", "-b" }; … … 303 306 return NULL; 304 307 } 305 if (( *arg_p = PyString_AsString(item)) == NULL) {308 if ((p = PyString_AsString(item)) == NULL) { 306 309 free(argv); 307 310 Py_DECREF(item); … … 310 313 return NULL; 311 314 } 315 if ((*arg_p = (char *)malloc(strlen(p))) == NULL) { 316 Py_DECREF(item); 317 Py_DECREF(authHandler); 318 Py_DECREF(daemon_args); 319 PyErr_SetString(PyExc_MemoryError, "malloc failed"); 320 return NULL; 321 } 322 strcpy(*arg_p, p); 323 312 324 arg_p++; 313 325 Py_DECREF(item); -
TI05-delivery/trunk/src/python_ext/util.c
r1289 r1353 13 13 #include <string.h> 14 14 #include <Python.h> 15 #include <unistd.h> 16 #include <stdio.h> 15 17 16 18 #include "util.h" 19 20 /** 21 * dump pid to a file and sleep. For use when debugging. 22 * @param secs number of seconds to sleep 23 */ 24 void ndg_debug_sleep(int secs) { 25 FILE *fh; 26 fh = fopen("pybbftpd.pid", "w"); 27 fprintf(fh, "%d\n", getpid()); 28 fclose(fh); 29 30 sleep(secs); 31 } 32 17 33 18 34 /** -
TI05-delivery/trunk/src/python_ext/util.h
r1289 r1353 27 27 28 28 void ndg_pyerr_to_logmessage(char *logmessage, char *prefix); 29 void ndg_debug_sleep(int secs); 29 30
Note: See TracChangeset
for help on using the changeset viewer.