Skip to content

Commit

Permalink
backport pypy plugin changes
Browse files Browse the repository at this point in the history
  • Loading branch information
niol committed Nov 4, 2024
1 parent d161714 commit b6aabc3
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 185 deletions.
11 changes: 10 additions & 1 deletion plugins/pypy/pypy_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ static int uwsgi_pypy_init() {
if (start && end) {
buffer = uwsgi_concat2n(start, end-start, "", 0);
}
#if defined(__APPLE__)
else {
unsigned long setup_size = 0;
char *setup_data = (char*)getsectiondata(&_mh_execute_header, "__DATA", "pypy_setup", &setup_size);
if (setup_data) {
buffer = uwsgi_concat2n(setup_data, setup_size, "", 0);
}
}
#endif
}

if (!buffer) {
Expand Down Expand Up @@ -224,7 +233,7 @@ static void uwsgi_pypy_preinit_apps() {

static int uwsgi_pypy_request(struct wsgi_request *wsgi_req) {
/* Standard WSGI request */
if (!wsgi_req->uh->pktsize) {
if (!wsgi_req->len) {
uwsgi_log( "Empty pypy request. skip.\n");
return -1;
}
Expand Down
Loading

0 comments on commit b6aabc3

Please sign in to comment.