Changeset 25000
- Timestamp:
- Aug 4, 2009, 2:55:24 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/nebclient/src/nebclient.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/nebclient/src/nebclient.c
r24999 r25000 1057 1057 static off_t nebCopyFilehandle(nebServer *server, int sourceFH, int destFH) 1058 1058 { 1059 off_t bytesTotal; 1060 off_t bytesRemaining; 1061 off_t writeSize; 1062 char writeBuf[64 * 1024]; 1059 REQUIRE_SERVER; 1060 1063 1061 struct stat sourceStat; 1064 1065 REQUIRE_SERVER;1066 1067 1062 if(fstat(sourceFH, &sourceStat)) { 1068 1063 nebSetErr(server, "can not stat filehandles: %s", strerror(errno)); … … 1072 1067 1073 1068 // the size of the file to copied 1074 bytesTotal = sourceStat.st_size;1069 off_t bytesTotal = sourceStat.st_size; 1075 1070 1076 1071 /* … … 1080 1075 */ 1081 1076 1082 bytesRemaining = bytesTotal;1077 off_t bytesRemaining = bytesTotal; 1083 1078 1084 1079 while (bytesRemaining) { 1080 off_t writeSize; 1081 char writeBuf[64 * 1024]; 1085 1082 if (bytesRemaining <= sizeof(writeBuf)) { 1086 1083 writeSize = bytesRemaining; … … 1110 1107 static size_t nebParseURI(nebServer *server, const char *URI, char **filename) 1111 1108 { 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 1121 1109 REQUIRE_SERVER; 1122 1110 … … 1133 1121 } 1134 1122 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); 1136 1129 if (status != 0) { 1137 1130 regerror(status, &myregex, errbuf, ERRBUF_SIZE); … … 1151 1144 regfree(&myregex); 1152 1145 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; 1156 1149 1157 1150 if (matchStart == -1) { … … 1159 1152 } 1160 1153 1161 filename_size = matchLength + 1;1154 size_t filename_size = matchLength + 1; 1162 1155 *filename = xmalloc(filename_size); 1163 1156
Note:
See TracChangeset
for help on using the changeset viewer.
