added script for external app loading

This commit is contained in:
roberto@precise64
2012-02-24 06:49:54 +01:00
parent f58be4241f
commit ad783ccaf0
2 changed files with 21 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
use IO::Socket::INET;
my $s = IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => $ARGV[0]);
my $mountpoint = $ARGV[1];
my $app = $ARGV[2];
my $uwsgi_appid = pack('v', length('UWSGI_APPID')).'UWSGI_APPID'.pack('v', length($mountpoint)).$mountpoint;
my $uwsgi_script = pack('v', length('UWSGI_SCRIPT')).'UWSGI_SCRIPT'.pack('v', length($app)).$app;
$s->send(pack('CvC', 5, length($uwsgi_appid.$uwsgi_script),0).$uwsgi_appid.$uwsgi_script);
while((my $cnt = $s->recv(my $buf, 4096))> 0) {
print $buf;
}
+6
View File
@@ -96,6 +96,8 @@ XS(XS_cache_set) {
char *key, *val;
STRLEN keylen;
STRLEN vallen;
if (uwsgi.cache_max_items == 0) goto clear;
psgi_check_args(2);
@@ -104,6 +106,7 @@ XS(XS_cache_set) {
uwsgi_cache_set(key, (uint16_t) keylen, val, (uint64_t) vallen, 0, 0);
clear:
XSRETURN_UNDEF;
}
@@ -113,6 +116,8 @@ XS(XS_cache_get) {
char *key, *val;
STRLEN keylen;
uint64_t vallen;
if (uwsgi.cache_max_items == 0) goto clear;
psgi_check_args(1);
@@ -121,6 +126,7 @@ XS(XS_cache_get) {
val = uwsgi_cache_get(key, (uint16_t) keylen, &vallen);
if (!val)
clear:
XSRETURN_UNDEF;
ST(0) = newSVpv(val, vallen);