projects
/
simpleserver-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not sv_free session handle if close handler is called
[simpleserver-moved-to-github.git]
/
SimpleServer.xs
diff --git
a/SimpleServer.xs
b/SimpleServer.xs
index
623949c
..
34cbb9a
100644
(file)
--- a/
SimpleServer.xs
+++ b/
SimpleServer.xs
@@
-1,5
+1,5
@@
/*
/*
- * $Id: SimpleServer.xs,v 1.29 2004-06-05 22:18:09 adam Exp $
+ * $Id: SimpleServer.xs,v 1.33 2004-06-07 17:00:55 adam Exp $
* ----------------------------------------------------------------------
*
* Copyright (c) 2000-2004, Index Data.
* ----------------------------------------------------------------------
*
* Copyright (c) 2000-2004, Index Data.
@@
-103,18
+103,20
@@
CV * simpleserver_sv2cv(SV *handler) {
}
/* debugging routine to check for destruction of Perl interpreters */
}
/* debugging routine to check for destruction of Perl interpreters */
-#if 1
-int tst_clones(void)
+#ifdef USE_ITHREADS
+void tst_clones(void)
{
int i;
PerlInterpreter *parent = PERL_GET_CONTEXT;
{
int i;
PerlInterpreter *parent = PERL_GET_CONTEXT;
- for (i = 0; i<500; i++)
+ for (i = 0; i<5000; i++)
{
PerlInterpreter *perl_interp;
{
PerlInterpreter *perl_interp;
+ PERL_SET_CONTEXT(parent);
PL_perl_destruct_level = 2;
PL_perl_destruct_level = 2;
- perl_interp = perl_clone(parent, 0);
+ perl_interp = perl_clone(parent, CLONEf_CLONE_HOST);
PL_perl_destruct_level = 2;
PL_perl_destruct_level = 2;
+ PERL_SET_CONTEXT(perl_interp);
perl_destruct(perl_interp);
perl_free(perl_interp);
}
perl_destruct(perl_interp);
perl_free(perl_interp);
}
@@
-136,7
+138,7
@@
int simpleserver_clone(void) {
if (!current) {
PerlInterpreter *perl_interp;
PERL_SET_CONTEXT( root_perl_context );
if (!current) {
PerlInterpreter *perl_interp;
PERL_SET_CONTEXT( root_perl_context );
- perl_interp = perl_clone(root_perl_context, 0);
+ perl_interp = perl_clone(root_perl_context, CLONEf_CLONE_HOST);
PERL_SET_CONTEXT( perl_interp );
}
}
PERL_SET_CONTEXT( perl_interp );
}
}
@@
-564,7
+566,6
@@
int bend_sort(void *handle, bend_sort_rr *rr)
temp = hv_fetch(href, "STATUS", 6, 1);
status = newSVsv(*temp);
temp = hv_fetch(href, "STATUS", 6, 1);
status = newSVsv(*temp);
-
PUTBACK;
FREETMPS;
LEAVE;
PUTBACK;
FREETMPS;
LEAVE;
@@
-595,11
+596,9
@@
int bend_search(void *handle, bend_search_rr *rr)
STRLEN len;
int i;
char **basenames;
STRLEN len;
int i;
char **basenames;
- int n;
WRBUF query;
char *ptr;
SV *point;
WRBUF query;
char *ptr;
SV *point;
- SV *ODR_point;
Zfront_handle *zhandle = (Zfront_handle *)handle;
CV* handler_cv = 0;
Zfront_handle *zhandle = (Zfront_handle *)handle;
CV* handler_cv = 0;
@@
-1045,7
+1044,6
@@
int bend_scan(void *handle, bend_scan_rr *rr)
char *ODR_errstr;
STRLEN len;
int term_len;
char *ODR_errstr;
STRLEN len;
int term_len;
- SV *term_tmp;
SV *entries_ref;
Zfront_handle *zhandle = (Zfront_handle *)handle;
CV* handler_cv = 0;
SV *entries_ref;
Zfront_handle *zhandle = (Zfront_handle *)handle;
CV* handler_cv = 0;
@@
-1171,7
+1169,6
@@
bend_initresult *bend_init(bend_initrequest *q)
SV *handle;
HV *href;
SV **temp;
SV *handle;
HV *href;
SV **temp;
- SV *status;
ENTER;
SAVETMPS;
ENTER;
SAVETMPS;
@@
-1280,7
+1277,6
@@
void bend_close(void *handle)
{
HV *href;
Zfront_handle *zhandle = (Zfront_handle *)handle;
{
HV *href;
Zfront_handle *zhandle = (Zfront_handle *)handle;
- SV **temp;
CV* handler_cv = 0;
int stop_flag = 0;
dSP;
CV* handler_cv = 0;
int stop_flag = 0;
dSP;
@@
-1305,7
+1301,8
@@
void bend_close(void *handle)
sv_free((SV*) href);
}
sv_free((SV*) href);
}
- sv_free(zhandle->handle);
+ else
+ sv_free(zhandle->handle);
PUTBACK;
FREETMPS;
LEAVE;
PUTBACK;
FREETMPS;
LEAVE;