mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-10-11 01:23:42 +00:00
now correct
git-svn-id: http://svn.code.sf.net/p/netboot65/code@333 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
2dd9feee33
commit
3d79a99023
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
.importzp copy_dest
|
.importzp copy_dest
|
||||||
.importzp buffer_ptr
|
.importzp buffer_ptr
|
||||||
|
.importzp scratch_ptr
|
||||||
|
|
||||||
.import http_parse_request
|
.import http_parse_request
|
||||||
.import http_get_value
|
.import http_get_value
|
||||||
@ -264,6 +265,8 @@ httpd_handler:
|
|||||||
stax httpd_port_number
|
stax httpd_port_number
|
||||||
tsx
|
tsx
|
||||||
stx top_of_stack
|
stx top_of_stack
|
||||||
|
ldax #__http_variables_buffer
|
||||||
|
stax http_variables_buffer
|
||||||
|
|
||||||
ldax #listening
|
ldax #listening
|
||||||
jsr print
|
jsr print
|
||||||
@ -393,7 +396,11 @@ http_callback:
|
|||||||
bne @look_for_eol
|
bne @look_for_eol
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
send_buffer:
|
||||||
|
ldax output_buffer_length
|
||||||
|
stax tcp_send_data_len
|
||||||
|
ldax httpd_io_buffer
|
||||||
|
jsr tcp_send
|
||||||
|
|
||||||
reset_output_buffer:
|
reset_output_buffer:
|
||||||
ldax httpd_io_buffer
|
ldax httpd_io_buffer
|
||||||
@ -405,19 +412,11 @@ reset_output_buffer:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
send_buffer:
|
|
||||||
ldax output_buffer_length
|
|
||||||
stax tcp_send_data_len
|
|
||||||
ldax httpd_io_buffer
|
|
||||||
jsr tcp_send
|
|
||||||
jmp reset_output_buffer
|
|
||||||
|
|
||||||
|
|
||||||
emit_string:
|
emit_string:
|
||||||
stax copy_src
|
stax scratch_ptr
|
||||||
ldy #0
|
ldy #0
|
||||||
@next_byte:
|
@next_byte:
|
||||||
lda (copy_src),y
|
lda (scratch_ptr),y
|
||||||
beq @done
|
beq @done
|
||||||
jsr xmit_a
|
jsr xmit_a
|
||||||
iny
|
iny
|
||||||
@ -426,15 +425,48 @@ emit_string:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
got_http_request:
|
got_http_request:
|
||||||
|
|
||||||
jsr http_parse_request
|
jsr http_parse_request
|
||||||
|
|
||||||
ldax #path
|
ldax #path
|
||||||
jsr print
|
jsr print
|
||||||
lda #$02
|
lda #$02
|
||||||
jsr http_get_value
|
jsr http_get_value
|
||||||
stax copy_src
|
stax scratch_ptr
|
||||||
jsr print
|
jsr print
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
@find_null:
|
||||||
|
lda (scratch_ptr),y
|
||||||
|
beq @found_null
|
||||||
|
iny
|
||||||
|
bne @find_null
|
||||||
|
@found_null:
|
||||||
|
sty param_length
|
||||||
|
|
||||||
|
lda #'P'
|
||||||
|
sta VARNAM
|
||||||
|
lda #'A'+$80
|
||||||
|
sta VARNAM+1
|
||||||
|
|
||||||
|
jsr GETVAR ;find the variable of this name (or else make a blank one)
|
||||||
|
lda param_length
|
||||||
|
jsr GETSPA ;create space in the string table of appropriate length
|
||||||
|
ldy #$00 ;set up string variable pointer
|
||||||
|
sta (VARPNT),Y ;string length
|
||||||
|
iny
|
||||||
|
lda FRESPC ;lo byte of area just reserved
|
||||||
|
sta (VARPNT),Y
|
||||||
|
iny
|
||||||
|
lda FRESPC+1 ;hi byte of area just reserved
|
||||||
|
sta (VARPNT),Y
|
||||||
|
|
||||||
|
ldx scratch_ptr
|
||||||
|
ldy scratch_ptr+1
|
||||||
|
lda param_length
|
||||||
|
jsr MOVSTR
|
||||||
|
|
||||||
;now restore stack to how it was when &HTTPD was called, and return to BASIC
|
;now restore stack to how it was when &HTTPD was called, and return to BASIC
|
||||||
ldx top_of_stack
|
ldx top_of_stack
|
||||||
txs
|
txs
|
||||||
@ -471,7 +503,7 @@ send_header:
|
|||||||
ldax #content_type_buffer
|
ldax #content_type_buffer
|
||||||
jsr emit_string
|
jsr emit_string
|
||||||
ldax #end_of_header
|
ldax #end_of_header
|
||||||
jmp emit_string
|
jsr emit_string
|
||||||
|
|
||||||
flush_handler:
|
flush_handler:
|
||||||
lda output_buffer_length
|
lda output_buffer_length
|
||||||
@ -595,7 +627,6 @@ xmit_a_ptr:
|
|||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
transfer_buffer: .res 256
|
|
||||||
param_length: .res 1
|
param_length: .res 1
|
||||||
ping_counter: .res 1
|
ping_counter: .res 1
|
||||||
handler_address: .res 2
|
handler_address: .res 2
|
||||||
@ -610,5 +641,6 @@ tcp_buffer_ptr: .res 2
|
|||||||
top_of_stack: .res 1
|
top_of_stack: .res 1
|
||||||
polling_counter: .res 1
|
polling_counter: .res 1
|
||||||
string_ptr: .res 1
|
string_ptr: .res 1
|
||||||
|
transfer_buffer: .res 256
|
||||||
|
__http_variables_buffer: .res 256; temp buffer for storing variables
|
||||||
__httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests.
|
__httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests.
|
||||||
|
|
||||||
|
@ -8,8 +8,10 @@
|
|||||||
40 &IPCFG
|
40 &IPCFG
|
||||||
50 &PING "192.168.10.2"
|
50 &PING "192.168.10.2"
|
||||||
60 &PING "192.168.10.2" , 5
|
60 &PING "192.168.10.2" , 5
|
||||||
|
70 PA$="DUMMY"
|
||||||
100 &HTTPD 8080
|
100 &HTTPD 8080
|
||||||
1000 PRINT "HELLO FOO!"
|
1000 PRINT "HELLO FOO!"
|
||||||
|
1005 PRINT PA$
|
||||||
1010 &!"HOWDY DOODY DOO!"
|
1010 &!"HOWDY DOODY DOO!"
|
||||||
1020 &FLUSH
|
1020 &FLUSH
|
||||||
1030 GOTO 100
|
1030 GOTO 100
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user