httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r155867 - httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h
Date Wed, 02 Mar 2005 03:49:56 GMT
Author: joes
Date: Tue Mar  1 19:49:54 2005
New Revision: 155867

URL: http://svn.apache.org/viewcvs?view=rev&rev=155867
Log:
Remove unported junk that's causing Win32
build problems.

Modified:
    httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h

Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h
URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h?view=diff&r1=155866&r2=155867
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h
(original)
+++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request/Param/APR__Request__Param.h
Tue Mar  1 19:49:54 2005
@@ -65,219 +65,3 @@
 
     return sv_bless(newRV_noinc(sv), SvSTASH(SvRV(rv)));
 }
-
-
-/* Upload-related stuff */
-#if 0
-
-APR_INLINE
-static SV *apreq_xs_find_bb_obj(pTHX_ SV *in)
-{
-    while (in && SvROK(in)) {
-        SV *sv = SvRV(in);
-        switch (SvTYPE(sv)) {            
-            MAGIC *mg;
-        case SVt_PVIO:
-            if (SvMAGICAL(sv) && (mg = mg_find(sv,PERL_MAGIC_tiedscalar))) {
-               in = mg->mg_obj;
-               break;
-            }
-            Perl_croak(aTHX_ "panic: cannot find tied scalar in pvio magic");
-        case SVt_PVMG:
-            if (SvOBJECT(sv) && SvIOKp(sv))
-                return sv;
-        default:
-             Perl_croak(aTHX_ "panic: unsupported SV type: %d", SvTYPE(sv));
-       }
-    }
-    return in;
-}
-
-
-static XS(apreq_xs_upload_brigade_copy)
-{
-    dXSARGS;
-    apr_bucket_brigade *bb, *bb_copy;
-    char *class;
-    SV *sv, *obj;
-
-    if (items != 2 || !SvPOK(ST(0)) || !SvROK(ST(1)))
-        Perl_croak(aTHX_ "Usage: Apache::Upload::Brigade->new($bb)");
-
-    class = SvPV_nolen(ST(0));
-    obj = apreq_xs_find_bb_obj(aTHX_ ST(1));
-    bb = (apr_bucket_brigade *)SvIVX(obj);
-    bb_copy = apr_brigade_create(bb->p,bb->bucket_alloc);
-    apreq_brigade_copy(bb_copy, bb);
-
-    sv = sv_setref_pv(newSV(0), class, bb_copy);
-    if (SvTAINTED(obj))
-        SvTAINTED_on(SvRV(sv));
-    ST(0) = sv_2mortal(sv);
-    XSRETURN(1);
-}
-
-static XS(apreq_xs_upload_brigade_read)
-{
-    dXSARGS;
-    apr_bucket_brigade *bb;
-    apr_bucket *e, *end;
-    IV want = -1, offset = 0;
-    SV *sv, *obj;
-    apr_status_t s;
-    char *buf;
-
-    switch (items) {
-    case 4:
-        offset = SvIV(ST(3));
-    case 3:
-        want = SvIV(ST(2));
-    case 2:
-        sv = ST(1);
-        SvUPGRADE(sv, SVt_PV);
-        if (SvROK(ST(0))) {
-            obj = apreq_xs_find_bb_obj(aTHX_ ST(0));
-            bb = (apr_bucket_brigade *)SvIVX(obj);
-            break;
-        }
-    default:
-        Perl_croak(aTHX_ "Usage: $bb->READ($buf,$len,$off)");
-    }
-
-    if (want == 0) {
-        SvCUR_set(sv, offset);
-        XSRETURN_IV(0);
-    }
-
-    if (APR_BRIGADE_EMPTY(bb)) {
-        SvCUR_set(sv, offset);
-        XSRETURN_UNDEF;
-    }
-
-    if (want == -1) {
-        const char *data;
-        apr_size_t dlen;
-        e = APR_BRIGADE_FIRST(bb);
-        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
-        if (s != APR_SUCCESS)
-            apreq_xs_croak(aTHX_ newHV(), s, 
-                           "Apache::Upload::Brigade::READ", 
-                           "APR::Error");
-        want = dlen;
-        end = APR_BUCKET_NEXT(e);
-    }
-    else {
-        switch (s = apr_brigade_partition(bb, (apr_off_t)want, &end)) {
-            apr_off_t len;
-
-        case APR_INCOMPLETE:
-            s = apr_brigade_length(bb, 1, &len);
-            if (s != APR_SUCCESS)
-                apreq_xs_croak(aTHX_ newHV(), s, 
-                               "Apache::Upload::Brigade::READ", 
-                               "APR::Error");
-            want = len;
-
-        case APR_SUCCESS:
-            break;
-
-        default:
-            apreq_xs_croak(aTHX_ newHV(), s, 
-                           "Apache::Upload::Brigade::READ",
-                           "APR::Error");
-        }
-    }
-
-    SvGROW(sv, want + offset + 1);
-    buf = SvPVX(sv) + offset;
-    SvCUR_set(sv, want + offset);
-    if (SvTAINTED(obj))
-        SvTAINTED_on(sv);
-
-    while ((e = APR_BRIGADE_FIRST(bb)) != end) {
-        const char *data;
-        apr_size_t dlen;
-        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
-        if (s != APR_SUCCESS)
-            apreq_xs_croak(aTHX_ newHV(), s, 
-                           "Apache::Upload::Brigade::READ", "APR::Error");
-        memcpy(buf, data, dlen);
-        buf += dlen;
-        apr_bucket_delete(e);
-    }
-
-    *buf = 0;
-    SvPOK_only(sv);
-    SvSETMAGIC(sv);
-    XSRETURN_IV(want);
-}
-
-static XS(apreq_xs_upload_brigade_readline)
-{
-    dXSARGS;
-    apr_bucket_brigade *bb;
-    apr_bucket *e;
-    SV *sv, *obj;
-    apr_status_t s;
-    unsigned tainted;
-
-    if (items != 1 || !SvROK(ST(0)))
-        Perl_croak(aTHX_ "Usage: $bb->READLINE");
-
-    obj = apreq_xs_find_bb_obj(aTHX_ ST(0));
-    bb = (apr_bucket_brigade *)SvIVX(obj);
-
-    if (APR_BRIGADE_EMPTY(bb))
-        XSRETURN(0);
-
-    tainted = SvTAINTED(obj);
-
-    XSprePUSH;
-
-    sv = sv_2mortal(newSVpvn("",0));
-    if (tainted)
-        SvTAINTED_on(sv);
-        
-    XPUSHs(sv);
-
-    while (!APR_BRIGADE_EMPTY(bb)) {
-        const char *data;
-        apr_size_t dlen;
-        const char *eol;
-
-        e = APR_BRIGADE_FIRST(bb);
-        s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
-        if (s != APR_SUCCESS)
-            apreq_xs_croak(aTHX_ newHV(), s, 
-                           "Apache::Upload::Brigade::READLINE",
-                           "APR::Error");
-
-        eol = memchr(data, '\012', dlen); /* look for LF (linefeed) */
-
-        if (eol != NULL) {
-            if (eol < data + dlen - 1) {
-                dlen = eol - data + 1;
-                apr_bucket_split(e, dlen);
-            }
-
-            sv_catpvn(sv, data, dlen);
-            apr_bucket_delete(e);
-
-            if (GIMME_V != G_ARRAY || APR_BRIGADE_EMPTY(bb))
-                break;
-
-            sv = sv_2mortal(newSVpvn("",0));
-            if (tainted)
-                SvTAINTED_on(sv);
-            XPUSHs(sv);
-        }
-        else {
-            sv_catpvn(sv, data, dlen);
-            apr_bucket_delete(e);
-        }
-    }
-
-    PUTBACK;
-}
-
-#endif



Mime
View raw message