IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25000


Ignore:
Timestamp:
Aug 4, 2009, 2:55:24 PM (17 years ago)
Author:
jhoblitt
Message:

more code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/nebclient.c

    r24999 r25000  
    10571057static off_t nebCopyFilehandle(nebServer *server, int sourceFH, int destFH)
    10581058{
    1059     off_t           bytesTotal;
    1060     off_t           bytesRemaining;
    1061     off_t           writeSize;
    1062     char            writeBuf[64 * 1024];
     1059    REQUIRE_SERVER;
     1060
    10631061    struct stat     sourceStat;
    1064 
    1065     REQUIRE_SERVER;
    1066 
    10671062    if(fstat(sourceFH, &sourceStat)) {
    10681063        nebSetErr(server, "can not stat filehandles: %s", strerror(errno));
     
    10721067
    10731068    // the size of the file to copied
    1074     bytesTotal = sourceStat.st_size;
     1069    off_t bytesTotal = sourceStat.st_size;
    10751070
    10761071    /*
     
    10801075    */
    10811076
    1082     bytesRemaining = bytesTotal;
     1077    off_t bytesRemaining = bytesTotal;
    10831078
    10841079    while (bytesRemaining) {
     1080        off_t writeSize;
     1081        char writeBuf[64 * 1024];
    10851082        if (bytesRemaining <= sizeof(writeBuf)) {
    10861083            writeSize = bytesRemaining;
     
    11101107static size_t nebParseURI(nebServer *server, const char *URI, char **filename)
    11111108{
    1112     regex_t         myregex;
    1113     regmatch_t      mymatch[2];
    1114     char            errbuf[ERRBUF_SIZE];
    1115     char            *pattern = "^file://(.*)$";
    1116     int             status;
    1117     size_t          matchStart, matchEnd;
    1118     size_t          matchLength;
    1119     size_t          filename_size;
    1120 
    11211109    REQUIRE_SERVER;
    11221110
     
    11331121    }
    11341122
    1135     status = regcomp(&myregex, pattern, REG_EXTENDED);
     1123    regex_t myregex;
     1124    regmatch_t mymatch[2];
     1125    char *pattern = "^file://(.*)$";
     1126    char errbuf[ERRBUF_SIZE];
     1127
     1128    int status = regcomp(&myregex, pattern, REG_EXTENDED);
    11361129    if (status != 0) {
    11371130        regerror(status, &myregex, errbuf, ERRBUF_SIZE);
     
    11511144    regfree(&myregex);
    11521145
    1153     matchStart = (size_t)mymatch[1].rm_so;
    1154     matchEnd   = (size_t)mymatch[1].rm_eo;
    1155     matchLength = matchEnd - matchStart;
     1146    size_t matchStart = (size_t)mymatch[1].rm_so;
     1147    size_t matchEnd   = (size_t)mymatch[1].rm_eo;
     1148    size_t matchLength = matchEnd - matchStart;
    11561149
    11571150    if (matchStart == -1) {
     
    11591152    }
    11601153
    1161     filename_size = matchLength + 1;
     1154    size_t filename_size = matchLength + 1;
    11621155    *filename = xmalloc(filename_size);
    11631156
Note: See TracChangeset for help on using the changeset viewer.