// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if SECURITY_DEP
-
using System.Collections;
using System.Collections.Specialized;
using System.Globalization;
if (current != null) {
cookies.Add (current);
}
- current = new Cookie ();
- int idx = str.IndexOf ('=');
- if (idx > 0) {
- current.Name = str.Substring (0, idx).Trim ();
- current.Value = str.Substring (idx + 1).Trim ();
- } else {
- current.Name = str.Trim ();
- current.Value = String.Empty;
+ try {
+ current = new Cookie ();
+ int idx = str.IndexOf ('=');
+ if (idx > 0) {
+ current.Name = str.Substring (0, idx).Trim ();
+ current.Value = str.Substring (idx + 1).Trim ();
+ } else {
+ current.Name = str.Trim ();
+ current.Value = String.Empty;
+ }
+ current.Version = version;
+ } catch (CookieException) {
+ current = null;
}
- current.Version = version;
}
}
if (current != null) {
return false;
if (InputStream.EndRead (ares) <= 0)
return true;
- } catch (ObjectDisposedException e) {
+ } catch (ObjectDisposedException) {
input_stream = null;
return true;
} catch {
}
public long ContentLength64 {
- get { return content_length; }
+ get { return is_chunked ? -1 : content_length; }
}
public string ContentType {
}
}
}
-#endif