~ubuntu-branches/ubuntu/quantal/aria2/quantal

« back to all changes in this revision

Viewing changes to src/HttpHeader.cc

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2010-11-24 12:26:31 UTC
  • mfrom: (1.6.1 upstream) (2.3.8 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124122631-upujekj1ek94h3x2
Tags: 1.10.6-1
* New upstream release:
  + Fixed FTBFS on alpha arch (Closes: #590257)
  + Added IPv6 support (Closes: #448390)
* debian/patches/ftbfs_kfreebsd.diff:
  + Dropped, merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
    // but some server returns '100-199/100', omitting bytes-unit sepcifier
170
170
    // 'bytes'.
171
171
    std::pair<std::string, std::string> splist;
172
 
    util::split(splist, rangeStr, ' ');
 
172
    util::divide(splist, rangeStr, ' ');
173
173
    if(splist.second.empty()) {
174
174
      // we assume bytes-unit specifier omitted.
175
175
      byteRangeSpec = splist.first;
178
178
    }
179
179
  }
180
180
  std::pair<std::string, std::string> byteRangeSpecPair;
181
 
  util::split(byteRangeSpecPair, byteRangeSpec, '/');
 
181
  util::divide(byteRangeSpecPair, byteRangeSpec, '/');
 
182
 
 
183
  if(util::strip(byteRangeSpecPair.first) == "*" ||
 
184
     util::strip(byteRangeSpecPair.second) == "*") {
 
185
    // If byte-range-resp-spec or instance-length is "*", we returns
 
186
    // empty Range. The former is usually sent with 416 (Request range
 
187
    // not satisfiable) status.
 
188
    return SharedHandle<Range>(new Range());
 
189
  }
182
190
 
183
191
  std::pair<std::string, std::string> byteRangeRespSpecPair;
184
 
  util::split(byteRangeRespSpecPair, byteRangeSpecPair.first, '-');
 
192
  util::divide(byteRangeRespSpecPair, byteRangeSpecPair.first, '-');
185
193
 
186
194
  off_t startByte = util::parseLLInt(byteRangeRespSpecPair.first);
187
195
  off_t endByte = util::parseLLInt(byteRangeRespSpecPair.second);
214
222
{
215
223
  std::string line;
216
224
  while(std::getline(in, line)) {
217
 
    line = util::trim(line);
 
225
    line = util::strip(line);
218
226
    if(line.empty()) {
219
227
      continue;
220
228
    }
221
229
    std::pair<std::string, std::string> hp;
222
 
    util::split(hp, line, ':');
 
230
    util::divide(hp, line, ':');
223
231
    put(hp.first, hp.second);
224
232
  }
225
233
}