From 3dda89dc1396d5f95711d7f1b5a63bc4087a9ec2 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Tue, 12 Jan 1999 19:45:46 +0000 Subject: [PATCH] Added GetContentLength and GetServerStatus to nsIURL class --- network/module/nsHttpUrl.cpp | 19 +++++++++++++++++++ network/module/nsHttpUrl.h | 2 ++ network/public/nsIURL.h | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/network/module/nsHttpUrl.cpp b/network/module/nsHttpUrl.cpp index b2abcff40854..635a12b6227e 100644 --- a/network/module/nsHttpUrl.cpp +++ b/network/module/nsHttpUrl.cpp @@ -882,6 +882,25 @@ nsresult nsHttpUrlImpl::SetPostData(nsIInputStream* input) return NS_OK; } +nsresult nsHttpUrlImpl::GetContentLength(PRInt32 *len) +{ + NS_LOCK_INSTANCE(); + *len = m_URL_s->content_length; + NS_UNLOCK_INSTANCE(); + return NS_OK; +} + + + +nsresult nsHttpUrlImpl::GetServerStatus(PRInt32 *status) +{ + NS_LOCK_INSTANCE(); + *status = m_URL_s->server_status; + NS_UNLOCK_INSTANCE(); + return NS_OK; +} + + nsresult nsHttpUrlImpl::ToString(PRUnichar* *unichars) const { nsAutoString string; diff --git a/network/module/nsHttpUrl.h b/network/module/nsHttpUrl.h index c8869acfcc87..bf92bf505743 100644 --- a/network/module/nsHttpUrl.h +++ b/network/module/nsHttpUrl.h @@ -53,6 +53,8 @@ public: NS_IMETHOD SetURLGroup(nsIURLGroup* group); NS_IMETHOD SetPostHeader(const char* name, const char* value); NS_IMETHOD SetPostData(nsIInputStream* input); + NS_IMETHOD GetContentLength(PRInt32 *len); + NS_IMETHOD GetServerStatus(PRInt32 *status); NS_IMETHOD ToString(PRUnichar* *aString) const; // from nsINetlibURL: diff --git a/network/public/nsIURL.h b/network/public/nsIURL.h index 5ed5346fb9dd..2e334b18da2f 100644 --- a/network/public/nsIURL.h +++ b/network/public/nsIURL.h @@ -95,6 +95,10 @@ public: NS_IMETHOD SetPostHeader(const char* name, const char* value) = 0; NS_IMETHOD SetPostData(nsIInputStream* input) = 0; + + NS_IMETHOD GetContentLength(PRInt32 *len) = 0; + + NS_IMETHOD GetServerStatus(PRInt32 *status) = 0; /** Write the URL to aString, overwriting previous contents. */ NS_IMETHOD ToString(PRUnichar* *aString) const = 0;