Subversion Repositories Kolibri OS

Rev

Rev 4832 | Rev 4834 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4832 Rev 4833
Line 53... Line 53...
53
        jz      error
53
        jz      error
54
        mov     [file_struct.buf], eax
54
        mov     [file_struct.buf], eax
55
        mov     [clipboard_data], eax
55
        mov     [clipboard_data], eax
56
        mcall   70, file_struct
56
        mcall   70, file_struct
57
        cmp     eax, 6
57
        cmp     eax, 6
58
        jne     error
58
        jne     error_free_clip
59
        mov     [clipboard_data_length], ebx
59
        mov     [clipboard_data_length], ebx
60
        mov     eax, [clipboard_data]
60
        mov     eax, [clipboard_data]
Line 61... Line 61...
61
 
61
 
Line 75... Line 75...
75
        mcall   54
75
        mcall   54
76
        cmp     eax, -1
76
        cmp     eax, -1
77
        je      error
77
        je      error
Line 78... Line 78...
78
 
78
 
79
; Verify if we can work with it
-
 
80
        cmp     dword[eax + 4], 0               ; text ?
-
 
81
        jne     error
79
; Verify if we can work with it
-
 
80
        mov     [clipboard_data], eax
-
 
81
        cmp     dword[eax + 4], 0               ; text ?
-
 
82
        jne     error_free_clip
-
 
83
 
82
        mov     [clipboard_data], eax
84
; Save length in [clipboard_data_length]
83
        mov     ecx, dword[eax]
85
        mov     ecx, dword[eax]
84
        sub     ecx, 8
86
        sub     ecx, 8
Line 85... Line 87...
85
        mov     [clipboard_data_length], ecx
87
        mov     [clipboard_data_length], ecx
86
 
88
 
Line 87... Line 89...
87
        mov     eax, [clipboard_data]
89
; Skip clipboard containter params for escape proc
88
        add     eax, 12
90
        add     eax, 12
89
 
91
 
90
escape:
92
escape:
91
; Escape all characters that need escaping
93
; Escape all characters that need escaping
92
        invoke  HTTP_escape, eax
94
        invoke  HTTP_escape, eax
Line 93... Line 95...
93
        test    eax, eax
95
        test    eax, eax
94
        jz      error
96
        jz      error_free_clip
95
        mov     [clipboard_data_length], ebx
97
        mov     [clipboard_data_length], ebx
Line 96... Line 98...
96
 
98
 
97
        push    eax
99
        push    eax
98
        mcall   68, 13, [clipboard_data]
100
        mcall   68, 13, [clipboard_data]
99
        pop     [clipboard_data]
101
        pop     [clipboard_data]
100
 
102
 
Line 101... Line 103...
101
; Connect to the server
103
; Connect to the server
102
        invoke  HTTP_get, sz_url, 0
104
        invoke  HTTP_get, sz_url, 0
103
        test    eax, eax
105
        test    eax, eax
Line 137... Line 139...
137
 
139
 
138
        mov     ecx, [clipboard_data_length]
140
        mov     ecx, [clipboard_data_length]
139
        add     ecx, sz_paste_head.length + sz_paste_tail.length
141
        add     ecx, sz_paste_head.length + sz_paste_tail.length
140
        invoke  HTTP_post, sz_url, sz_cookie, sz_ctype, ecx
142
        invoke  HTTP_post, sz_url, sz_cookie, sz_ctype, ecx
141
        test    eax, eax
143
        test    eax, eax
142
        jz      error
144
        jz      error_free_clip
Line -... Line 145...
-
 
145
        mov     [identifier], eax
143
        mov     [identifier], eax
146
 
144
 
147
; Send the data to the server
145
        mov     ecx, [eax + http_msg.socket]
148
        mov     ecx, [eax + http_msg.socket]
146
        mcall   75, 6, , sz_paste_head, sz_paste_head.length, 0
149
        mcall   75, 6, , sz_paste_head, sz_paste_head.length, 0
Line -... Line 150...
-
 
150
        mcall   75, 6, , [clipboard_data], [clipboard_data_length], 0
-
 
151
        mcall   75, 6, , sz_paste_tail, sz_paste_tail.length, 0
-
 
152
 
147
        mcall   75, 6, , [clipboard_data], [clipboard_data_length], 0
153
; Free the data
148
        mcall   75, 6, , sz_paste_tail, sz_paste_tail.length, 0
154
        mcall   68, 13, [clipboard_data]
149
 
155
 
150
  .again2:
156
  .again2:
Line 151... Line 157...
151
        invoke  HTTP_process, [identifier]
157
        invoke  HTTP_process, [identifier]
152
        test    eax, eax
158
        test    eax, eax
153
        jnz     .again2
159
        jnz     .again2
Line 154... Line 160...
154
 
160
 
155
        mov     ebp, [identifier]
161
        mov     ebp, [identifier]
156
        cmp     [ebp + http_msg.status], 302    ; found
162
        cmp     [ebp + http_msg.status], 302    ; found
Line 157... Line 163...
157
        jne     error
163
        jne     error_free_http
158
 
164
 
159
        invoke  HTTP_find_header_field, [identifier], sz_location
165
        invoke  HTTP_find_header_field, [identifier], sz_location
160
        test    eax, eax
166
        test    eax, eax
Line 194... Line 200...
194
        mcall   54, 2, , paste_url-4    ; Write URL to the clipboard
200
        mcall   54, 2, , paste_url-4    ; Write URL to the clipboard
Line 195... Line 201...
195
 
201
 
196
        invoke  HTTP_free, [identifier]
202
        invoke  HTTP_free, [identifier]
Line -... Line 203...
-
 
203
        mcall   -1
-
 
204
 
-
 
205
error_free_http:
-
 
206
        invoke  HTTP_free, [identifier]
-
 
207
        jmp     error
197
        mcall   -1
208
error_free_clip:
198
 
209
        mcall   68, 13, [clipboard_data]
199
error:
210
error:
Line 200... Line 211...
200
        mov     [notify_struct.msg], sz_failed
211
        mov     [notify_struct.msg], sz_failed