summaryrefslogtreecommitdiff
path: root/www/mozilla/patches/patch-ay
blob: e872d38acce8df5e4eabe5bd60a07fe7c9274dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
$NetBSD: patch-ay,v 1.7 2002/02/09 03:54:48 taya Exp $

diff -ru ../Orig/mozilla/netwerk/base/src/nsSocketTransport.h ./netwerk/base/src/nsSocketTransport.h
--- ../Orig/mozilla/netwerk/base/src/nsSocketTransport.h	Wed Nov 28 09:42:57 2001
+++ ./netwerk/base/src/nsSocketTransport.h	Sat Feb  9 09:22:49 2002
@@ -176,7 +176,7 @@
     PRFileDesc* GetSocket(void)      { return mSocketFD;    }
     PRInt16     GetSelectFlags(void) { return mSelectFlags; }
     PRCList*    GetListNode(void)    { return &mListLink;   }
-    
+
     static nsSocketTransport* GetInstance(PRCList* qp) { return (nsSocketTransport*)((char*)qp - offsetof(nsSocketTransport, mListLink)); }
     
     PRBool CanBeReused() { return 
@@ -237,8 +237,27 @@
     inline void ClearFlag(nsSocketReadWriteInfo aFlag) {
         mReadWriteState &= ~aFlag;
     } 
+
+    PRInt32     GetSocketPort(void)  { return (mProxyPort != -1 && !mProxyTransparent) ? mProxyPort : mPort; }
+    const char *GetSocketHost(void)  { return (mProxyHost && !mProxyTransparent) ? mProxyHost : mHostName; }
     
 protected:
+    class nsNetAddrList {
+    public:
+        nsNetAddrList() : mList(nsnull), mLen(0) {}
+       ~nsNetAddrList() { delete[] mList; }
+
+        // allocate space for the address list
+        nsresult Init(PRUint32 len);
+
+        // given a net addr in the list, return the next addr.
+        // if given NULL, then return the first addr in the list.
+        // returns NULL if given addr is the last addr.
+        PRNetAddr *GetNext(PRNetAddr *currentAddr);
+    private:
+        PRNetAddr *mList;
+        PRUint32   mLen;
+    };
     
     nsSocketState                   mCurrentState;
     nsCOMPtr<nsIRequest>            mDNSRequest;
@@ -249,7 +268,8 @@
     PRIntervalTime                  mLastActiveTime;
     PRCList                         mListLink;
     PRMonitor*                      mMonitor;
-    PRNetAddr                       mNetAddress;
+    nsNetAddrList                   mNetAddrList;
+    PRNetAddr                      *mNetAddress;
     nsSocketOperation               mOperation;
     nsCOMPtr<nsISupports>           mSecurityInfo;
 
@@ -415,6 +435,7 @@
     PRBool IsInitialized() { return mStartFired; }
     PRBool IsSuspended() { return mSuspendCount > 0; }
     PRBool IsCanceled() { return mCanceled; }
+    PRBool HasFailed() { return NS_FAILED(mStatus); }
 
     void SetTransport(nsSocketTransport *);
     void SetObserver(nsIRequestObserver *obs) { mObserver = obs; }