Changeset 650 for trunk/src/tcl


Ignore:
Timestamp:
Mar 29, 2007 8:57:18 AM (17 years ago)
Author:
dkearney
Message:

fixed binary upload by correctly recognizing binary files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tcl/src/RpEncodeTclInterface.cc

    r649 r650  
    1313 */
    1414#include <tcl.h>
    15 #include <ctype.h>
    1615#include "RpBuffer.h"
    1716#include "RpEncodeTclInterface.h"
     
    4544{
    4645    int index = 0;
    47     int err = 0;
    4846
    4947    for (index = 0; index < size; index++) {
    50         err = isascii(buf[index]);
    51         if (err == 0) {
    52             return index;
    53         }
     48        if (((buf[index] >= '\000') && (buf[index] <= '\010')) ||
     49            ((buf[index] >= '\013') && (buf[index] <= '\014')) ||
     50            ((buf[index] >= '\016') && (buf[index] <= '\037')) ||
     51            ((buf[index] >= '\177') && (buf[index] <= '\377')) ) {
     52            // data is binary
     53            return index+1;
     54        }
     55
    5456    }
    5557    return 0;
     
    246248    buf = Rappture::Buffer(option,optionLen);
    247249
    248     /*
    249     if (base64 == 0) {
    250         if (isbinary(buf.bytes(),buf.size()) != 0) {
    251             // data is binary, make sure it is base64 encoded
    252             base64 = 1;
    253         }
    254     }
    255     */
    256 
    257250    buf.encode(compress,base64);
    258251    result = Tcl_GetObjResult(interp);
Note: See TracChangeset for help on using the changeset viewer.