Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #375 (closed defect: fixed)

Opened 17 years ago

Last modified 17 years ago

HttpClient.open(Pump pump) doesn't call pump back

Reported by: CyberShadow Assigned to: kris
Priority: major Milestone: 0.97 RC 1
Component: Tango Version:
Keywords: Cc:

Description

The reason seems to be in the line:

  if (pump.ptr)
    pump (emit);

pump.ptr isn't a correct way to check if the user supplied an argument or not - apparently this fails for functions on the stack... If changed to if (pump), it works.

Change History

04/03/07 01:51:59 changed by CyberShadow

Singular test case:

import tango.io.Console;

alias void delegate (char[]) DlgProc;

void callThis(DlgProc proc)
{
	Cout("proc     is ")(proc    ?"NOT NULL":"NULL").newline;
	Cout("proc.ptr is ")(proc.ptr?"NOT NULL":"NULL").newline;
}

void main()
{
	void myProc(char[] s)
	{
		Cout(s).newline;
	}

	callThis(&myProc);
}

This outputs:

proc     is NOT NULL
proc.ptr is NULL

04/03/07 02:03:42 changed by kris

  • owner changed from sean to kris.
  • component changed from Core Functionality to Tango.
  • milestone set to 0.97 RC 1.

Drat. Apparently should be using .funcptr instead.

Thx :)

04/03/07 02:03:56 changed by kris

  • status changed from new to closed.
  • resolution set to fixed.